16.03.2011, 17:44
The same for ban just:
pawn Код:
CMD:ban(playerid, parans[])
{
new pName[MAX_PLAYER_NAME]; // Here we are defining the kicking's name
GetPlayerName(playerid, pName, sizeof(pName));
if(!IsPlayerAdmin(playerid)) return 0; // Checking if the player is rcon.
new targetid, reason[64], string[128]; // targetid is also a pName
if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_RED, "Usage: /ban [playerid/partofname] [reason]"); // here it tells the player to use /kick playerid reason or /kick partofname reason
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Player not connected or is yourself!"); // This is if the player is not connected, or you can't ban yourself.
format(string, sizeof(string), "%s has been banned by Rcon Admin (Reason: %s)",pName, reason);
SendClientMessageToAll(COLOR_YELLOW, string); // The yellow define will be up!
Ban(targetid);
return 1;
}