Raised This Month: $ Target: $400
 0% 

Global Shared CVARS - How To ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
kurian
Member
Join Date: Aug 2005
Old 06-06-2007 , 08:23   Re: Global Shared CVARS - How To ?
Reply With Quote #8

Quote:
Originally Posted by sawce View Post
It doesn't matter how many plugins register a cvar, if it has already been registered when another call is made, register_cvar() will act basically like get_cvar_pointer(), and give you the pointer to it for use with pcvars. The value of the already existing cvar will not be changed by subsequent calls to it via register_cvar().
So what your saying is that I can simply write

Code:
amx_override_spec = register_cvar("amx_override_spec","1")
So the first time the function is called, the CVAR will be created and its value will be set to 1. Then suppose the user changes the value to 0 by typing amx_override_spec 0 in console. Then if the function is executed again in another plugin, it will simply return a CVAR pointer and the value will still remain at 0 even though register_cvar re initializes it with a value of 1 ?


If so then this seems to be the best option. Because I CANNOT add any code in the plugins themselves, everything must be contained in the include file.
__________________
[IMG]http://img267.**************/img267/8526/userbarjg9.gif[/IMG]
kurian 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 10:41.


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