hooking "jointeam" cmd
Code:
register_clcmd("jointeam", "join_team")
retrieving arguments of client command as string
Code:
new arg[2]
read_argv(1, arg , charsmax(arg))
converting string (arg ) to num and checking if it matches with some numbers : (1= Team T , 2= Team CT , 5=Auto join and 6=Team Spectate)
Code:
if ( str_to_num(arg) == 1 || str_to_num(arg) == 5)
showing them chooseteam menu again , and blocking user from joining that team
Code:
engclient_cmd(id,"chooseteam")
return PLUGIN_HANDLED
allow joining
Code:
return PLUGIN_CONTINUE