Quote:
|
Originally Posted by JeNkStAX
pawn Код:
// Top of OnPlayerCommandText new idx; new tmp[128]; new cmd[128]; cmd = strtok(cmdtext, idx);
// Command if(strcmp(cmd, "/kill2", true) == 0) { tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid, color, "Usage: /kill2 [playerid/name]"); return 1; } new player = ReturnUser(tmp); SetPlayerHealth(player, 0); return 1; }
|
I'd like to make it, that's why I asked if he has strtok.
Also same about ReturnUser. (which could be done with strval instead.)
But I don't get it, JeNkStAX.
Why do you use the usage like that?
pawn Код:
if(!strlen(tmp))
{
SendClientMessage(playerid, color, "Usage: /kill2 [playerid/name]");
return 1;
}