Ok....i'm trying to use flags for the pcvars and it isn't working.
Here is my code....
PHP Code:
new spawn_pcvar
new cvarBits
#define ON (1 << 0) // a
#define BACKPACK (1 << 1) // b
#define CLIP (1 << 2) // c
public plugin_precache()
{
spawn_pcvar = register_cvar("source_spawn", "abc")
new szFlags[10]
get_pcvar_string(spawn_pcvar, szFlags, charsmax(szFlags) )
cvarBits = read_flags(szFlags)
}
// Then to access....
if(is_user_bot(id) || !is_user_alive(id) || !(cvarBits & ON))
{
new f[10]
get_pcvar_string(spawn_pcvar, f, charsmax(f) )
client_print(id, print_console, "The plugin is off %d, %s", cvarBits, f)
return HAM_IGNORED
}
Always prints in console
Code:
The plugin is off 65536, 1
No matter what i put in for the cvar.
Am i missing something?
EDIT: aaannnnddd.....an episode of wtf theater....
It just doesn't recognize "source_spawn" as a cvar. When i changed the cvar name, it started working again.
wtf!?
__________________