I think i read about this somewhere, however i cannot find it anymore, looked through the forums a half hour now searching for all kinda weird terms :/
Would be great with a link for the example or just a quick example in a reply
player_say hook: as in when people talk we can choose to display it or not.
thanks in advance
player_say hook?
player_say hook?
-Tuck
You mean a SayFilter?
Syntax: Select all
from commands.say import SayFilter
@SayFilter
def my_say_filter(playerinfo, teamonly, command):
if <something>:
# Block the message from being displayed in chat
return False
You can use SayText(2) to display your own message. You can also do what ES does, and call the "say" command again:
The plugin itself does not support returning a new value and calling the client command on its own (nor will it). You must do this yourself.
Syntax: Select all
from commands.say import SayFilter
from engines.server import EngineServer
from players.helpers import edict_from_playerinfo
@SayFilter
def my_say_filter(playerinfo, teamonly, command):
if <something>:
command = 'say_team' if teamonly else 'say'
# Force the player to say something
EngineServer.client_command(edict_from_playerinfo(
playerinfo, '{0} This is some new text'.format(command))
# Block the message from being displayed in chat
return False
The plugin itself does not support returning a new value and calling the client command on its own (nor will it). You must do this yourself.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 76 guests