PDA

View Full Version : How to make this, so you can't ban administrators?


rangerxxll
22/06/2012, 10:10 PM
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.
if(Target == PlayerInfo[Target][pAdmin] >=1) return SendClientMessage(playerid,COLOR_RED, "ERROR: You can't kick other Administrators");

and the warning. warning 213: tag mismatch

Any help would be greatly appreciated.

Kindred
22/06/2012, 10:39 PM
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.

Calgon
22/06/2012, 11:11 PM
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.

rangerxxll
23/06/2012, 01:36 AM
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.

Dan_Barocu
23/06/2012, 01:46 AM
&& = and

rangerxxll
23/06/2012, 01:51 AM
Thanks.

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