Hey I'm having a problem with a say command.
Ive got this in my plugin_init()
PHP Code:
register_clcmd("say /whois", "cmd_whois", 0, "<target> ")
and then later on in the code...
PHP Code:
public cmd_whois(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new Arg1[24]
new Arg2[24]
read_argv(2, Arg2, 23)
new player = cmd_target(id, Arg2, 1)
if (!player)
{
console_print(id, "Sorry, player %s could not be found or targetted!", Arg1)
return PLUGIN_HANDLED
}
else
{
new name[18];
get_user_name(player,name,17);
new motd[2048],tempstring[2048];
add(motd,2048,"<html><strong><b>");
format(tempstring,2048,"Rank and Badge Stats for Player %s </strong></b>", name)
add(motd,2048,tempstring);
add(motd,2048,"<br><br>");
format(tempstring,2048,"Players Rank: %s",RANKS[g_PlayerRank[player]])
add(motd,2048,tempstring);
add(motd,2048,"<br>");
add(motd,2048,"Current Badges Owned: <br>");
for (new counter=0; counter<MAX_BADGES; counter++)
{
if(g_PlayerBadges[player][counter]!=0)
{
format(tempstring,2048," -%s<br>",BADGES[counter][g_PlayerBadges[player][counter]])
add(motd,2048,tempstring);
}
}
add(motd,2048,"</html>");
show_motd(id,motd,"Player Info")
}
return PLUGIN_HANDLED
}
It works fine if I type "say /whois name" directly into the console but if I try do it as normal say "/whois name" it just prints to the screen and doesn't execute the function at all.
Any help would be appreciated.
Thanks