Raised This Month: $ Target: $400
 0% 

better way to declare CVARs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-14-2011 , 11:35   Re: better way to declare CVARs
Reply With Quote #1

You could cache the value :

- Into a global var, like each new round or something. The cons is your var won't be updated in real-time.
- Using my awesome module Cvar Utilities, you can hook a value change of a cvar and caching the value into a global var. It will updated in real-time.
__________________
Arkshine is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-14-2011 , 13:50   Re: better way to declare CVARs
Reply With Quote #2

I don't know of any cvar that needs to be real-time updated. 99% of cvars could be cached on init and nobody would know the difference.
__________________
fysiks is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 07-14-2011 , 14:34   Re: better way to declare CVARs
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
You could cache the value :

- Into a global var, like each new round or something. The cons is your var won't be updated in real-time.
- Using my awesome module Cvar Utilities, you can hook a value change of a cvar and caching the value into a global var. It will updated in real-time.
wonderful module but i don't want any extra module


Quote:
I don't know of any cvar that needs to be real-time updated. 99% of cvars could be cached on init and nobody would know the difference.
init is a good idea ...lemme try that
gamer99 is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 07-14-2011 , 14:46   Re: better way to declare CVARs
Reply With Quote #4

init is not working ... i am checking is a client prethink ... And declaring the cvar as global ....

I don wanna any extra module .... better I will check every time in prethink
gamer99 is offline
Reply



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 01:07.


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