Question regarding commands
Posted: Fri Jan 22, 2016 3:00 pm
Hey,
I need your help since im not getting what I want.
I tried to add a !info <mapname> command, when its just !info it uses currentMap
Would this work? It seems the arg_count removes the !info command, but how can you actually get the first argument or the 2nd one etc.
I need your help since im not getting what I want.
I tried to add a !info <mapname> command, when its just !info it uses currentMap
Syntax: Select all
@SayCommand("!info")
@ClientCommand("sm_info")
def printInfoStats(command, index, team=None):
userid = userid_from_index(index)
if command.get_arg_count(): #0 if just !info
mapName = command.get_arg_string(0).lower()
if not validMap(mapName):
return tell(player.userid, "map_not_found", {"mapName": mapName})
else:
mapName = global_vars.map_name
#insert code xxx
Would this work? It seems the arg_count removes the !info command, but how can you actually get the first argument or the 2nd one etc.