Raised This Month: $ Target: $400
 0% 

Adding, removing, checking bitsums


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 05-27-2007 , 18:09   Adding, removing, checking bitsums
Reply With Quote #1

I was just wondering if I did this the correct way.

PHP Code:
#define FLAG_A (1<<0)
#define FLAG_B (1<<1)
#define FLAG_C (1<<2)
 
stock get_player_flags(idflags)
 return (
g_user_flags[id] & flags)
 
stock set_player_flags(idflags)
 return 
g_user_flags[id] |= flags
 
// add
set_player_flags(idFLAG_A)
 
// remove
set_player_flags(id, ~FLAG_B)
 
// check
if(!get_player_flags(idFLAG_C))
  return 
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.

Last edited by Cheap_Suit; 05-27-2007 at 21:32.
Cheap_Suit 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:41.


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