Raised This Month: $ Target: $400
 0% 

get_flags


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-21-2014 , 11:37   Re: get_flags
Reply With Quote #6

Checking a variable/array value is definitely better than calling a native function.

You can do this, too:
PHP Code:
public client_putinserver(id)
{
        
vipAccessid ] = ( get_user_flagsid ) & VipAccess ) ? true false;

If you plan on having multiple-flags then it's safer to do this because using (flags & Access) will return true if it finds only 1 matching flag. So if you have 4 flags, it can return true if the user has only 1, or any number of the Access flags.
PHP Code:
public client_putinserver(id)
{
        
vipAccessid ] = ( ( get_user_flagsid ) & VipAccess ) = VipAccess ) ? true false;

You also want to size your vipAccess array to 33; if a user on slot 32 connects you will get an index out of bounds error.
__________________

Last edited by Bugsy; 01-21-2014 at 11:46.
Bugsy is offline
 



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 10:14.


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