Can we compact this in one line?
#1

Delete
Reply
#2

I'm guessing you'd just be able to use 'if(adminlvl != 0)' or 'if(adminlvl > 0)'. Not really going to be able to tell you much more given you didn't explain how your script admin levels work, or what exactly you're trying to accomplish.
Reply
#3

If this is supposed to check if the player isn't admin, then you could just do
Код:
if(admlvl == 0)
or
Код:
if(!admlvl)
But as rymax said you should have provided some sort of description of what you're trying to achieve.
Reply
#4

Delete
Reply
#5

The best method is:
pawn Код:
if(admlvl < 1)
Checks if the admin level is smaller than 1.

There are many other methods as well such like you can also use <= because its more easily readable:
pawn Код:
if(admlvl <= 0)
Checks if the admin level is smaller than or equal to 0.
Reply
#6

Still don't quite understand what you're trying to achive. Copying the entire command here would probably be helpful to get a full understanding.
Reply
#7

Delete
Reply
#8

Код:
if (admlvl < 1 || (admlvl > 4 && admlvl != 1337)) return SendClientMessageEx(playerid, COLOR_RED,"- >>Error<< - Valid Admin Levels: 1-4 and 1337!");
Reply
#9

Код:
if(admlvl < 1)
have you no experience with less than / greater than if statements?

this if statement checks if players admin level is less than 1, which means they're not admin.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)