Hey, so basically what this command is supposed to do is get the kills and wins of the person after the command. .stats <target>
However, whenever I type .stats RedRobster it doesn't show anything. But if I type .stats by itself, it shows my stats. Aswell as whenever anyone else types .stats it shows my stats, not theirs.
PHP Code:
public plugin_init()
{
//...Other Cvars, Commands, etc.
register_clcmd("say .stats","show_stats",ADMIN_ALL,"<target>") //Registers reg. chat command
register_clcmd("say_team .stats","show_stats",ADMIN_ALL, "<target>") //Registers team chat command
}
PHP Code:
public show_stats(id)
{
new Arg2[24] //Where <target> will be stored
read_argv(2,Arg2,23) //Reads <target> and stores as Arg2
new player = cmd_target(id,Arg2,0) //Gets ID of command target stored as "player"
new playername[25] //Where the target name will be stored
if(!player) //If target "player" doesn't exist
{
client_print_color(id,DontChange,"^3%s ^1could not be found.",Arg2) //Target doesn't exist
return PLUGIN_HANDLED
}
else
{
get_user_name(player,playername,24) //Gets full name of target
client_print_color(id,DontChange,"^3%s ^1has ^3%i Kills ^1and ^3%i Wins.",playername,PlayerKills[player],PlayerWins[player])
}
return PLUGIN_HANDLED
}