05.12.2009, 22:29
pawn Код:
dcmd_dkick(playerid, params[])
{
new
Kickid;
if(sscanf(params, "u", Kickid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dkick [playerid]");
if(IsPlayerAdmin(playerid) == 0) return SendClientMessage(playerid, COLOR_RED, "You are not an admin.");
if(Kickid == playerid) return SendClientMessage(playerid, COLOR_ORANGE, "You cannot kick yourself!");
if(IsPlayerAdmin(Kickid)) return SendClientMessage(playerid, COLOR_RED, "You may not kick admins.");
if(Kickid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "Player not found.");
new
KickedName[MAX_PLAYER_NAME],
AdminName[MAX_PLAYER_NAME],
KickMessage[128];
GetPlayerName(Kickid, KickedName, sizeof(KickedName));
GetPlayerName(playerid, AdminName, sizeof(AdminName));
format(KickMessage, sizeof(KickMessage), "%s has been kicked by %s!", KickedName, AdminName);
SendClientMessageToAll(COLOR_ORANGE, KickMessage);
Kick(Kickid);
return 1;
}