Raised This Month: $ Target: $400
 0% 

Reading single char from string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 03-22-2005 , 17:09   Re: Reading single char from string
Reply With Quote #4

Quote:
Originally Posted by xiiph
How do I check the value I get from get_user_flags() (<--- think thats the one with access flags...?) for a specific flag, in this case, "n".
From amxconst.inc:
Code:
#define ADMIN_LEVEL_B       (1<<13) /* flag "n" */

So, use:

Code:
if( get_user_flags( id ) & ADMIN_LEVEL_B ) {     // the user 'id' has flag 'n' }

Edit: the access() function that Avalanche posted is the exact same thing as what I wrote above, but it requires you include <amxmisc>

Remember tho, get_user_flags() returns a BitSum of the flags, not actual characters... to convert it to the character flags (and vice-versa), use these from amxmodx.inc:

Code:
/* Converts string to sum of bits. * Example: "abcd" is a sum of 1, 2, 4 and 8. */ native read_flags(const flags[]); /* Converts sum of bits to string. * Example: 3 will return "ab". */ native get_flags(flags,output[],len);

Edit: Avalanche, you posted just b4 me..
xeroblood is offline
Send a message via MSN to xeroblood
 



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 09:56.


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