How to make this, so you can't ban administrators?
#1

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.
Reply
#2

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.
Reply
#3

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.
Reply
#4

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.
Reply
#5

&& = and
Reply
#6

Thanks.

P.S: Your sig scared the shit out of me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)