Thread: Bits stuff
View Single Post
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 09-13-2015 , 16:24   Re: Bits stuff
Reply With Quote #2

PHP Code:
enum
{
  
ItemA << 0// 1
  
ItemB << 1// 2
  
ItemC << 2// 4
  
ItemD << 3// 8
  
ItemE << 4// 16

  
ItemZ << 31 // Last Entry (a value which is at most 1 << 31 - never exceed this)
}

new 
g_Store[MAX_PLAYERS 1]

// Add
g_Store[This] |= Item_B

// Remove
g_Store[This] &= ~Item_B

// Check
g_Store[This] & Item_B 

Last edited by claudiuhks; 09-13-2015 at 16:25.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks