SayCommands and args
Posted: Thu Jan 18, 2018 8:10 pm
Hey guys,
I've been trying to fetch arguments for SayCommands. My example is changerace from WCS. I try to read the chatmessage:
and want to read the argument given. but when I use arg_string or command_string it just returns changerace, not everything I say.
Now I'm wondering if this is on purpose and if so what should I use alternatively to do this.
I noticed that ClientCommand can read the args, but in this case I really need the SayCommand.
Thank you! :)
Edit: The code I use:
I've been trying to fetch arguments for SayCommands. My example is changerace from WCS. I try to read the chatmessage:
Code: Select all
changerace undead
and want to read the argument given. but when I use arg_string or command_string it just returns changerace, not everything I say.
Now I'm wondering if this is on purpose and if so what should I use alternatively to do this.
I noticed that ClientCommand can read the args, but in this case I really need the SayCommand.
Thank you! :)
Edit: The code I use:
Syntax: Select all
@SayCommand('changerace')
@ClientCommand('changerace')
def _changerace_command(command, index, team=None):
userid = userid_from_index(index)
if not command.arg_string:
changerace.HowChange(userid)
else:
changerace.HowChange(userid,command.arg_string)