Raised This Month: $ Target: $400
 0% 

How to get user Flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 05-13-2013 , 13:06   How to get user Flags
Reply With Quote #1

Hi
I am not asking how to get user flags like ADMIN_LEVEL_H but flag "t"
And if possible, get more then one flag at same time, example "bt"
__________________
Jhob94 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2013 , 13:33   Re: How to get user Flags
Reply With Quote #2

Quote:
Originally Posted by Jhob94 View Post
Hi
I am not asking how to get user flags like ADMIN_LEVEL_H but flag "t"
And if possible, get more then one flag at same time, example "bt"
PHP Code:
new szFlags26 ];
GetLetterFlagsid szFlags charsmaxszFlags ) );
server_printszFlags ); 
PHP Code:

GetLetterFlags
id szFlags[] , iMaxLen )
{
    new 
iFlags get_user_flagsid ) , iStartFlag 'a' iIndex;
    
    for ( new 
< ( 'z' 'a' ) ; i++ )
    {
        if ( 
iFlags & ( << ) )
        {
            
szFlagsiIndex++ ] = iStartFlag i;
        }
        
        if ( 
iIndex == iMaxLen )
            break;
    }
    
    return 
iIndex;

__________________

Last edited by Bugsy; 05-13-2013 at 13:34.
Bugsy is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 05-13-2013 , 13:35   Re: How to get user Flags
Reply With Quote #3

Can you give example?
I think i know +/- how to do but i dont want to make it wrong
__________________
Jhob94 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2013 , 13:36   Re: How to get user Flags
Reply With Quote #4

Quote:
Originally Posted by Jhob94 View Post
Can you give example?
I think i know +/- how to do but i dont want to make it wrong
Example of what ?
__________________
Bugsy is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 05-13-2013 , 13:40   Re: How to get user Flags
Reply With Quote #5

how to use GetLetterFlags
__________________
Jhob94 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2013 , 13:49   Re: How to get user Flags
Reply With Quote #6

Look at my post, I included an example.
__________________
Bugsy is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 05-13-2013 , 13:52   Re: How to get user Flags
Reply With Quote #7

Omfg xD
Sorry


EDIT:
Sorry if i didnt said clean what i want.
I want check if user has flags, not if him flags are exactly that.
How i can do if szFlags contain VIP_FLAGS_ACESS (#define VIP_FLAGS_ACESS "t" // VIP Flags (default:t - ADMIN_LEVEL_H))
__________________

Last edited by Jhob94; 05-13-2013 at 14:15.
Jhob94 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2013 , 14:21   Re: How to get user Flags
Reply With Quote #8

?

PHP Code:
const VIP_FLAGS_ACCESS ADMIN_LEVEL_H;

if ( 
get_user_flagsid ) & VIP_FLAGS_ACCESS )
{
     
//user has flag
}

//or you can include multiple flags
const VIP_FLAGS_ACCESS ADMIN_LEVEL_C ADMIN_LEVEL_H;

if ( ( 
get_user_flagsid ) & VIP_FLAGS_ACCESS ) == VIP_FLAGS_ACCESS )
{
     
//user has flags

__________________

Last edited by Bugsy; 05-13-2013 at 14:22.
Bugsy is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 05-13-2013 , 14:33   Re: How to get user Flags
Reply With Quote #9

Thats the problem... I use flags as "t" etc not ADMIN_LEVEL_H etc
__________________
Jhob94 is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 05-13-2013 , 14:38   Re: How to get user Flags
Reply With Quote #10

PHP Code:
if( has_flagid"t" ) )
{
    
// code
}

if( 
has_all_flagsid"bt" ) )
{
    
// code

dFF 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 16:23.


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