Raised This Month: $ Target: $400
 0% 

Global Shared CVARS - How To ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 06-05-2007 , 08:33   Re: Global Shared CVARS - How To ?
Reply With Quote #3

Maybe I'm completely missing your problem, but..

Code:
register_cvar("a_cvar", "1");
new cvar_pointer = get_cvar_pointer("a_cvar");
register_cvar() already checks to see if the cvar has been declared previously. Whether this is better is debatable because if the cvar does not already exist then you've just discarded the return value which you will then be interested in.

If these plugins are only for personal use then why not register the cvar in admincmd.sma or one of the other base add-ons..? In fact, why is this such an issue in the first place? plugin_init() should be the last place you look at optimising. The rest of the code should be perfect before you even consider this.

Last edited by Lee; 06-05-2007 at 09:18.
Lee 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