20.02.2013, 17:45
pawn Код:
CMD:kick(playerid, params[])
{
new id, reason[128], string[128], playername[MAX_PLAYER_NAME], playid[MAX_PLAYER_NAME];
if(sscanf(params, "us[127]", id, reason)){SendClientMessage(playerid, COLOR_RED, "Correct usage: /kick [playerid] [Reason]");}
else if(!IsPlayerConnected(id)){SendClientMessage(playerid, COLOR_RED, "The selected player is not connected.");}
else if(PlayerInfo[id][pAdmin] > 0) {SendClientMessage(playerid, COLOR_RED, "The selected player is an admin.");}
else{
GetPlayerName(id, playid, sizeof(playid));
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string),"[SERVER] %s has been kicked by %s. [Reason]: %s", playid, playername, reason[127]);
SendClientMessageToAll(COLOR_WHITE, string);
Kick(id);
}
return 1;
}
In the last samp update, the messages before kick will not get sent to the player, so you'd have to do a costume one
For more info click here