View Single Post
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 11-13-2020 , 16:18   Re: How to do with one variable
Reply With Quote #9

PHP Code:
#define MAX_PLAYERS    32

//Create a list of options that are supported by the plugin
enum ( <<=_Options
{
    
Speed=1// 1 << 0 or 1 
    
AutoAim,  // 1 << 1 or 1 << 1 (as value is calculated by enum)        
    
HighJump// 1 << 2 or 2 << 1
    
ExtraHP,   // 1 << 3 or 4 << 1
    
ExtraArmor // 1 << 4 or 8 << 1
}

//Define an array that will keep track of each option a player currently has
new g_OptionsMAX_PLAYERS+];

//Examples of how to apply option for player
g_Optionsid ] |= Speed;
g_Optionsid ] |= HighJump;
g_Optionsid ] |= ExtraArmor;

//Example how to check if a player has an option
if ( g_Optionsid ] & Speed )
    
//player has speed 
This was literally in Bugsy's thread. There's no way you could've missed it if you haven't read a bit yourself.

Last edited by redivcram; 11-13-2020 at 16:18.
redivcram is offline