18.09.2011, 20:17
PHP код:
COMMAND:kick(playerid,params[])
{
new playerid2,PlayerName[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
new tmp[256], Index, string[128], reason[32];
tmp = strtok(params,Index), playerid2 = strval(tmp);
GetPlayerName(playerid2,on,sizeof(on));
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
if(Account[playerid][Level] < 2) return SendClientMessage(playerid,Yellow,"You need to be level 2 to use this command!");
if (sscanf(params, "us[64]", playerid2,reason)) return SendClientMessage(playerid, Yellow, "Usage: /kick id reason");
if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,Yellow,"Player is not connected!");
format(string, sizeof(string),"Admin %s has kicked %s [Reason: %s]",PlayerName, on, reason);
SendClientMessageToAll(Blue, string);
Kick(playerid2);
return 1;
}