Hello,
could you tell me how I can hook player sprays in CS:S?
I just need the information which index used the spray.
Thanks
Hook Player Spray
Re: Hook Player Spray
I believe you can use the player_decal event for that.
Syntax: Select all
from events import Event
from players.entity import Player
@Event('player_decal')
def player_spray(event):
player = Player.from_userid(event['userid'])
Re: Hook Player Spray
Thank you :)
Re: Hook Player Spray
Would implementing a "spray ban" feature be as simple as just blocking this event with a pre-event hook?
(also sry if i'm not supposed to necro old posts, i can make a seperate post if nessessary)
(also sry if i'm not supposed to necro old posts, i can make a seperate post if nessessary)
- L'In20Cible
- Project Leader
- Posts: 1534
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: Hook Player Spray
Zeus wrote:Would implementing a "spray ban" feature be as simple as just blocking this event with a pre-event hook?
Syntax: Select all
from effects.hooks import TempEntityPreHook
from messages import SayText2
denied_message = SayText2('Sorry, you cannot use spray on this server.')
@TempEntityPreHook('Player Decal')
def pre_player_decal(te, recipients):
denied_message.send(te.player_index)
return False
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 15 guests