08.08.2015, 17:26
Try This :c
PHP Code:
CMD:kick(playerid,params[])
{
if(P_Data[playerid][pAdmin] >= 1)
{
new PID; //define the playerid we wanna kick
new reason[64];
new global[90];
new local[91];
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
GetPlayerName(playerid, Adminname, sizeof(Adminname));
GetPlayerName(PID, Playername, sizeof(Playername));
if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_WHITE, "Folosire: /kick [playerid] [reason]");
if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, -1, "{FF0000}Eroare: Player-ul nu este online!");
if(P_Data[PID][pAdmin] >= P_Data[playerid][pAdmin]) return SendClientMessage(playerid, -1, "{FF0000}Eroare: Nu poti da kick la admini cu level mai mare sau egal cu al tau!");
format(local, sizeof(local), "{FF0000}Ai luat kick de la %s. Motiv: %s", GetName(playerid), reason);
SendClientMessage(PID, -1, local);
format(global, sizeof(global(, "{FF0000}AdminBot: %s a luat kick de la %s pe motivul: %s", GetName(PID), GetName(playerid), reason);
SendClientMessageToAll(-1, global);
return Kick(PID);
}
else
{
SendClientMessage(playerid, -1, "{FF0000}Eroare: Nu ai admin!");
}
return 1;
}