SA-MP Forums Archive
Operator bug - 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: Operator bug (/showthread.php?tid=613387)



Operator bug - justjamie - 27.07.2016

Hello,

i'm using this code:
PHP код:
if(!Player[playerid][Admin] || !Player[playerid][Helper]) return SendClientError(playerid,"You are not authorized to use this command!"); 
I am a helper, but not a admin, i can't use this command.
Why?


Re: Operator bug - Konstantinos - 27.07.2016

It checks "If not admin OR not helper". You are not an admin so it returns true. What you basically want is to check if you are none of those two - use AND (&&) instead.


Re: Operator bug - ThatFag - 27.07.2016

Код:
if(Player[playerid][Admin] || Player[playerid][Helper]) return SendClientError(playerid,"You are not authorized to use this command!");
! means - not


Re: Operator bug - justjamie - 27.07.2016

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
It checks "If not admin OR not helper". You are not an admin so it returns true. What you basically want is to check if you are none of those two - use AND (&&) instead.
thanks