How to make this, so you can't ban administrators? - 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: How to make this, so you can't ban administrators? (
/showthread.php?tid=353322)
How to make this, so you can't ban administrators? -
rangerxxll - 22.06.2012
I'm making this /ban command. And I want it, so if you're attempting to ban a admin, it wont let you. But if your admin rank is over 4, you can ban them. Here's my current line of code for it, but I get a warning.
pawn Код:
if(Target == PlayerInfo[Target][pAdmin] >=1) return SendClientMessage(playerid,COLOR_RED, "ERROR: You can't kick other Administrators");
and the warning.
pawn Код:
warning 213: tag mismatch
Any help would be greatly appreciated.
Re: How to make this, so you can't ban administrators? -
Kindred - 22.06.2012
pawn Код:
if(PlayerInfo[Target][pAdmin] >= 1)
This is all that is needed, this is checking if the players admin is greater than or equal to 1.
Re: How to make this, so you can't ban administrators? -
Calgon - 22.06.2012
pawn Код:
if(PlayerInfo[Target][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_RED, "ERROR: You can't kick other Administrators");
This code should check if the target is higher than admin level 1 and then if the admin is under admin level 4.
Re: How to make this, so you can't ban administrators? -
rangerxxll - 23.06.2012
Quote:
Originally Posted by Calgon
pawn Код:
if(PlayerInfo[Target][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_RED, "ERROR: You can't kick other Administrators");
This code should check if the target is higher than admin level 1 and then if the admin is under admin level 4.
|
Works perfectly. Could you explain to me what the "&&" does? Other than that, I get most of it.
Re: How to make this, so you can't ban administrators? -
Dan_Barocu - 23.06.2012
&& = and
Re: How to make this, so you can't ban administrators? -
rangerxxll - 23.06.2012
Thanks.
P.S: Your sig scared the shit out of me.