Raised This Month: $ Target: $400
 0% 

PCvars?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-07-2006 , 00:33   Re: PCvars?
Reply With Quote #2

they work a lot faster than normal get_cvar_* functions because they use pointers (I'm guessing, I know a little bit of C++ and I think I see why using pointers would help here, anyway...). You have to register them to a global variable (unless your only using it once). Heres some example code...
Code:
//i like to make it the same name as the actual cvar
new sv_my_cvar
public plugin_init()
{
    sv_my_cvar = register_cvar("sv_my_cvar","0")
}
my_function()
{
    client_print(0, print_chat, "wow, my cvar = %d", get_pcvar_num(sv_my_cvar))
}
*note that there is no set_pcvar_string
}
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
 



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 06:57.


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