Quote:
Originally Posted by Gazmull
pawn Код:
if(strcmp(cmd, "/kick", true) == 0) { if(!IsPlayerAdmin(playerid)) return 1; new ID,Reason[128], string[128]; if(sscanf(params, "us[128]", ID, Reason)) return SendClientMessage(playerid,WHITE,"USAGE: /Kick [ID] [Reason]"); if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,RED,"Player not found."); format(string, sizeof(string),"*** %s Has been kicked by: %s. (%s)",GetName(ID),GetName(playerid),Reason); SendClientMessageToAll(RED,string); TogglePlayerControllable(ID,false); Kick(ID); return 1; }
But i suggest to use ZCMD or DCMD.
|
Considering that code wouldn't work at all, it would be a good idea. Normal commands in OnPlayerCommandText do not have the 'params' variable.