23.02.2011, 12:47
pawn Код:
COMMAND:kick(playerid, params[])
{
new pid, reason[105];
if(PlayerInfo[playerid][pAdminlevel] >= 1) return SendClientMessage(playerid, 0xAAAAAAAA, "You are not admin or the required level.");
if(sscanf(params, "uS(No Reason Given)[128]", pid, reason)) return SendClientMessage(playerid, 0xFFFFFFFF, "/kick [playerid/name] [reason]");
if(IsPlayerConnected(pid) && pid != INVALID_PLAYER_ID && pid != playerid)
{
new adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], string[180];
GetPlayerName(pid, paramname, sizeof(paramname));
GetPlayerName(playerid, adminname, sizeof(adminname));
format(string, sizeof(string), "%s has been kicked by %s for: %s", paramname, adminname, reason);
SendClientMessageToAll(AdminColor, string);
Kick(pid);
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "This player is not connected Or Is Yourself.");
return 1;
}