- Notifications
You must be signed in to change notification settings - Fork0
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
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
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
- Install Source.Python.
- Downloadthe latest release of Enki.
- Extract the files into your game server's root folder.
(e.g. ../csgo/ for Counter-Strike: Global Offensive) - Restart your server.
# ../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.
Counter-Strike: Source
Counter-Strike: Global Offensive
Half Life 2: Deathmatch
Team Fortress 2
About
Custom package for Source.Python for handling player interactions with water.
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published