09.07.2011, 15:44
Well, you need strtok if you use strcmp.
You need to set some extra checks like if playerid is not filled in etc etc.
But this is a begin on how to make that command
pawn Код:
if(strcmp("/apm", cmdtext, 4) == 0)
{
new tmp, tmp2, idx, string;
tmp = strtok(cmdtext[5], idx);
tmp2 = strtok(cmdtext[7], idx);
if((!strlen(tmp)) || (!strlen(tmp2)))
{
SendClientMessage(playerid, {your color}, "USAGE: /apm [playerid] [message]");
}
else
{
format(string, sizeof(string), "ID %d: Admin says: %s", tmp, tmp2);
SendClientMessage(tmp, {your color}, string);
}
return 1;
}
But this is a begin on how to make that command