Raised This Month: $ Target: $400
 0% 

get_pcvar_string and read_flags


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-13-2012 , 19:47   get_pcvar_string and read_flags
Reply With Quote #1

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_pcvarszFlagscharsmax(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_pcvarfcharsmax(f) )
        
client_print(idprint_console"The plugin is off %d, %s"cvarBitsf)
        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!?
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 08-13-2012 at 20:10.
Liverwiz 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 05:47.


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