Checking for several flags
I had to do a check for three flags. I tried if(get_user_flags(id) & ADMIN_LEVEL_F | ADMIN_LEVEL_G | ADMIN_LEVEL_H), but everybody would pass this one. Should "|" be a comma or "&&"? Of course I also thought of three if statements, but that's obviously uneficient. How should I do it?
|
Re: Checking for several flags
PHP Code:
|
Re: Checking for several flags
Quote:
PHP Code:
|
Re: Checking for several flags
Quote:
but ur way is better I think |
Re: Checking for several flags
Quote:
|
Re: Checking for several flags
You can use read_flags too.
|
Re: Checking for several flags
Thank you both, guys! You're great!
|
Re: Checking for several flags
Quote:
|
Re: Checking for several flags
Quote:
|
Re: Checking for several flags
There's also the has_flag() stock. Essentially it encapsulates Bugsy's method.
http://www.amxmodx.org/api/amxmisc/has_flag Alternately, if you want them to have all the flags specified: http://www.amxmodx.org/api/amxmisc/has_all_flags |
All times are GMT -4. The time now is 22:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.