Command not working correct!
#1

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
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!");
It should send 2 Messages, one to all players and one to kicked player
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);
These not working/\

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;
}
Reply


Messages In This Thread
Command not working correct! - by andreistalker - 08.08.2015, 16:58
Re: Command not working correct! - by andreistalker - 08.08.2015, 17:02
Re: Command not working correct! - by jlalt - 08.08.2015, 17:26
Re: Command not working correct! - by XBrianX - 09.08.2015, 21:37
Re: Command not working correct! - by jlalt - 09.08.2015, 21:39
Re: Command not working correct! - by XBrianX - 09.08.2015, 21:43
Re: Command not working correct! - by jlalt - 09.08.2015, 21:45
Re: Command not working correct! - by XBrianX - 09.08.2015, 21:47

Forum Jump:


Users browsing this thread: 1 Guest(s)