Logical OR || Operator doesn't work properly
#2

It should be like this:
PHP код:
if(!IsPlayerAdmin(playerid) || pInfo[playerid][Admin] != 6) return SendClientMessage(playerid0xFFFFFFFF"[HPRP]: You don't have enough permissions to use this command"); 
In your code, It says, "If the player is not an admin or if he is an admin with level 6, Send error message". That's not what you want. What you want is, "If the player is not and admin or if he is not level 6, Send error message". The operator != translates to if the admin level is not equal to six. But I would recommend you to do this.

PHP код:
if(!IsPlayerAdmin(playerid) || pInfo[playerid][Admin] < 6) return SendClientMessage(playerid0xFFFFFFFF"[HPRP]: You don't have enough permissions to use this command"); 
This means players with level 6 and above can use the command.
Reply


Messages In This Thread
Logical OR || Operator doesn't work properly - by MiyuUchiha - 21.05.2018, 12:57
Re: Logical OR || Operator doesn't work properly - by DarkSkull - 21.05.2018, 13:02
Re: Logical OR || Operator doesn't work properly - by 10MIN - 21.05.2018, 13:08
Re: Logical OR || Operator doesn't work properly - by MiyuUchiha - 21.05.2018, 13:54

Forum Jump:


Users browsing this thread: 1 Guest(s)