21.01.2011, 04:39
pawn Код:
command(kick, playerid, params[])
{
new ID, string[128], reason[66];
if(PlayerInfo[playerid][pAdminLevel] >= 1) return SendClientMessage(playerid, 0xFFFF00AA,"You don't have authorization.");
if(sscanf(params, "uS(No Reason Given)[65]", ID, reason)) SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /kick [id] [optional: reason]");
else if(ID == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_LIGHTBLUE, "AdmCmd This player is not online!");
else
{
format(string,sizeof(string), "You have been kicked by Administrator %s Reason: %s", adminid,reason);
SendClientMessage(ID , COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have kicked %s %s", victimid, reason);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Administrator/VIP %s has kicked %s %s",adminid,victimid,reason);
SendClientMessageToAll( COLOR_LIGHTBLUE, string );
TogglePlayerControllable(ID, false);
Kick(ID);
}
return 1;
}
@[FeK]DraKiNs and PeteShag
It's 'S' not 's' for optional strings.