08.08.2015, 16:58
I made an Kick Command but is not working properly
What it dosn't do?
You can kick a you're level admin, but i wrote this and still not working
It should send 2 Messages, one to all players and one to kicked player
These not working/\
Code:
What it dosn't do?
You can kick a you're level admin, but i wrote this and still not working
HTML Code:
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!");
HTML Code:
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);
Code:
HTML 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); Kick(PID); } else { SendClientMessage(playerid, -1, "{FF0000}Eroare: Nu ai admin!"); } return 1; }