Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Custom package for Source.Python for handling player interactions with water.

License

NotificationsYou must be signed in to change notification settings

vinci6k/enki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a small custom package forSource.Python that gives plugin developers quick and easy access to the Player instance whenever the player starts or stops touching water.


First gif:water_spash.py; Second gif:water_walk.py

Installation

  1. Install Source.Python.
  2. Downloadthe latest release of Enki.
  3. Extract the files into your game server's root folder.
    (e.g. ../csgo/ for Counter-Strike: Global Offensive)
  4. Restart your server.

Usage

# ../water_splash/water_splash.py# Source.Pythonfromentities.entityimportEntityfromstringtablesimportstring_tables# Enkifromenki.listenersimportOnPlayerEnterWater@OnPlayerEnterWaterdefon_player_enter_water(player):"""Called when a player starts touching water."""# Did the player enter the water at a reasonable velocity?ifplayer.velocity.length>300:# Let's make a big water splash!particle=Entity.create('info_particle_system')particle.origin=player.origin# NOTE: This particle effect only exists in CS:GO, there are similar# effects in other games, e.g. 'water_splash_01' in CS:S.particle.effect_name='explosion_basic_water'particle.effect_index=string_tables.ParticleEffectNames.add_string('explosion_basic_water'        )particle.start()particle.delay(1,particle.remove)

There are a few moreexamples which showcase how this package works.
To see all the available imports/modules, head over to thewiki.

Supported Games

Counter-Strike: Source
Counter-Strike: Global Offensive
Half Life 2: Deathmatch
Team Fortress 2


[8]ページ先頭

©2009-2025 Movatter.jp