Admin sistem problem.
#10

serves you well?

pawn Код:
CMD:kick(playerid,params[])
{
new ID, reason[128];
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_RED,"Trebuie sa fi admin level 1 sa utilizezi aceasta comanda.");
   if(sscanf(params,"us[128]",ID,reason)) return SendClientMessage(playerid,COLOR_RED,"Foloseste /kick id motiv."); //declara parametrii
   if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,COLOR_RED,"Playerul nu este conectat.");//Verifica daca playerul este conectat
   format(str,sizeof str,"%s a primit kick de la adminul %s, motiv: %s.",pName(ID),pName(playerid),reason); //Primul %s corespunde cu prima variabila de dupa mesaj. Exemplu: primul %s corespunde cu name, al doilea cu aname, si al 3lea cu reason. Toate 3 sunt tip de string.
   SendClientMessageToAll(COLOR_RED,str);//Da mesaj tuturor
   Kick(ID); //da kick jucatorului pe care este executata comanda
   return 1;
}
define pName

pawn Код:
stock pName(playerid)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, sizeof(name));
  return name;
}
Reply


Messages In This Thread
Admin sistem problem. - by GabiXx - 01.10.2014, 06:25
Respuesta: Admin sistem problem. - by !R1Ch@rD! - 01.10.2014, 07:02
Re: Admin sistem problem. - by GabiXx - 01.10.2014, 07:05
Respuesta: Re: Admin sistem problem. - by !R1Ch@rD! - 01.10.2014, 07:06
Re: Admin sistem problem. - by GabiXx - 01.10.2014, 07:08
Respuesta: Re: Admin sistem problem. - by !R1Ch@rD! - 01.10.2014, 07:12
Re: Admin sistem problem. - by GabiXx - 01.10.2014, 07:15
Respuesta: Admin sistem problem. - by !R1Ch@rD! - 01.10.2014, 07:33
Re: Admin sistem problem. - by GabiXx - 01.10.2014, 07:43
Respuesta: Re: Admin sistem problem. - by !R1Ch@rD! - 01.10.2014, 07:53

Forum Jump:


Users browsing this thread: 2 Guest(s)