Operator bug
#1

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

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)