Raised This Month: $32 Target: $400
 8% 

check user have any flag ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 03-21-2019 , 08:59   check user have any flag ?
Reply With Quote #1

hii ,
which code is use to check whether player has any flags
like , i wanted to perform any function but check whether player has any flags like ADMIN_LEVEL_H OR ADMIN_LEVEL_bla bla

EDITS : i have seen a code but dont remeber it full : is_player_admins (i dont remeber that)
__________________
SED LYF !!!

Last edited by SHIELD755; 03-21-2019 at 09:01. Reason: :)
SHIELD755 is offline
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 03-21-2019 , 09:00   Re: check user have any flag ?
Reply With Quote #2

__________________
SED LYF !!!

Last edited by SHIELD755; 03-21-2019 at 09:02.
SHIELD755 is offline
Old 03-21-2019, 09:07
<VeCo>
This message has been deleted by <VeCo>.
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 03-21-2019 , 14:47   Re: check user have any flag ?
Reply With Quote #3

get_user_flags.
__________________








CrazY. is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-21-2019 , 15:17   Re: check user have any flag ?
Reply With Quote #4

https://www.amxmodx.org/api/amxmisc/has_flag
https://www.amxmodx.org/api/amxmisc/has_all_flags

get_user_flags(id) & FLAG_A|FLAG_B|FLAG_C
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 03-21-2019 , 22:32   Re: check user have any flag ?
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
i can use 2 or 3 flags once ?
__________________
SED LYF !!!
SHIELD755 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-21-2019 , 23:16   Re: check user have any flag ?
Reply With Quote #6

Yes, just 'or in' the ones you want checked, you can do as many as you want.
( FLAG_1 | FLAG_2 | FLAG_3 | FLAG_4 )

Keep in mind that this will only validate that one or more of the flags exists, not a guarantee that all exist.

If you want to be certain that all flags exist, do this:
PHP Code:
const FlagsToCheck = ( FLAG_1 FLAG_2 FLAG_3 );

if ( ( 
get_user_flagsid ) & FlagsToCheck ) == FlagsToCheck )
     
//player has FlagsToCheck flags, and possibly more.

if ( get_user_flagsid ) == FlagsToCheck )
     
//Player has only FlagsToCheck flags and nothing else 
__________________

Last edited by Bugsy; 03-21-2019 at 23:18.
Bugsy is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode