pawn Код:
if(strcmp("/kick", cmdtext, true, 5) == 0) // "/kick" is 5 bytes long
{
if(strlen(cmdtext[6]) == 0) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /kick [ID] [MSG]");
//lenght of string at byte 6+, 0 if there is nothing there
new id = strval(cmdtext[6]);
//value of the string at byte 6+
if(IsPlayerConnected(id) == 0) return SendClientMessage(playerid, 0xFF0000AA, "Player not connected");
//check if the player is connected
new pos = strfind(cmdtext, " ", true, 6);
//get the position of the string after the space
if(pos == -1) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /kick [ID] [MSG]");
//pos will be -1 if there is no space
if(strlen(cmdtext[pos + 1]) == 0) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /kick [ID] [MSG]");
//check if there is a string after the space (pos is space, + 1 more byte)
new string[128];
format(string, sizeof(string), "ID %d has been kicked for %s", id, cmdtext[pos + 1]);
SendClientMessageToAll(0xFFFFFFFF, string);
//format your crap as needed
Kick(id);
//kick player
return 1;
}