SA-MP Forums Archive
Don't understand that. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Don't understand that. (/showthread.php?tid=382635)



Don't understand that. - _Khaled_ - 04.10.2012

pawn Код:
//Command Set Admin Level
IRCCMD:isetadminlevel(botid, channel[], user[], host[], params[])
{
   // Check if the user has at least voice in the channel
    if (IRC_IsAdmin(botid, channel, user))
    {
      new pname[MAX_PLAYER_NAME];
      new playerid;
      new level;
      new id;
      new string[128];
      if(level == 5)
      {
       GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
       format(string, 128, "*** An IRC Administrator has set your administration level to Server Administrator.");
       SendClientMessage(playerid, COLOR_PINK, string);

       GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
       format(string,sizeof(string),"[ADMIN UPDATE] An IRC Administrator has set %s(%d)'s administration level to Server Administrator.",pname,playerid);
       IRC_GroupSay(groupID,ADMIN_CHANNEL,string);

       GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
       format(string,sizeof(string),"[ADMIN UPDATE] An IRC Administrator has set %s(%d)'s administration level to Server Administrator.",pname,playerid);
       SendAdminMessage(COLOR_PINK, string);

       PlayerInfo[id][pAdminLevel]=5;
      }
      if(level == 100)
      {
       GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
       format(string, 128, "*** An IRC Administrator has set your administration level to Server Head Administrator.");
       SendClientMessage(playerid, COLOR_PINK, string);

       GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
       format(string,sizeof(string),"[ADMIN UPDATE] An IRC Administrator has set %s(%d)'s administration level to Server Head Administrator.",pname,playerid);
       IRC_GroupSay(groupID,ADMIN_CHANNEL,string);

       GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
       format(string,sizeof(string),"[ADMIN UPDATE]An IRC Administrator has set %s(%d)'s administration level to Server Head Administrator.",pname,playerid);
       SendAdminMessage(COLOR_PINK, string);

       PlayerInfo[id][pAdminLevel]=100;
      }
      if(level == 0)
      {
       GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
       format(string, 128, "*** An IRC Administrator has demoted you, and set your administration level to none.");
       SendClientMessage(playerid, COLOR_PINK, string);

       GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
       format(string,sizeof(string),"[ADMIN UPDATE] An IRC Administrator has demoted %s(%d), and set his administration level to none.",pname,playerid);
       IRC_GroupSay(groupID,ADMIN_CHANNEL,string);

       GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
       format(string,sizeof(string),"[ADMIN UPDATE] An IRC Administrator has demoted %s(%d), and set his administration level to none.",pname,playerid);
       SendAdminMessage(COLOR_PINK, string);

       PlayerInfo[id][pAdminLevel]=0;
      }
   }
   return 1;
}
Код:
15:39	Kh4led	!isetadminlevel 0 100
15:39	[BOT]Ashley	[ADMIN UPDATE] An IRC Administrator has demoted Kh4led(0), and set his administration level to none.



Re: Don't understand that. - Red_Dragon. - 04.10.2012

Remove this
pawn Код:
if(level == 0)
And put this
pawn Код:
if(level == 100)
I think it will work because you do "if(level == 0)" then you will be demoted just try and tell me if it worked
EDIT: I am sorry i just wanted to help i am outta here


Re: Don't understand that. - _Khaled_ - 04.10.2012

Hmm,
I think I got what you mean..
But I want to get the level the admin inserted, not the player's level, how?


Re: Don't understand that. - CmZxC - 04.10.2012

Quote:
Originally Posted by Red_Dragon.
Посмотреть сообщение
Remove this
pawn Код:
if(level == 0)
And put this
pawn Код:
if(level == 100)
I think it will work because you do "if(level == 0)" then you will be demoted just try and tell me if it worked
Then nothing can demote admins.
Think logically.


Re: Don't understand that. - _Khaled_ - 04.10.2012

I need to get if !isetadminlevel 0 (100) then set admin level to 100, if 0 then set admin level to 0, same to 5.


Re: Don't understand that. - Roel - 04.10.2012

Trust me, I won't, I don't see you as a rival.


Re: Don't understand that. - _Khaled_ - 04.10.2012

Did I say your opinion even matters?


Re: Don't understand that. - Roel - 04.10.2012

You didn't say you didn't.


Re: Don't understand that. - _Khaled_ - 04.10.2012

Enough spamming.
some administrator please remove this comments.