Thread: cvar help.
View Single Post
hamza47sohail
Senior Member
Join Date: Jan 2014
Old 04-12-2014 , 14:37   Re: cvar help.
Reply With Quote #3

Quote:
Originally Posted by Powerlord View Post
So, something like

PHP Code:
if (GetConVarBool(g_Cvar_Handle))
{

Of course, to get the cvar handle you have to either call CreateConVar (to create a new one, should be done in OnPluginStart) or FindConVar (to get a handle to an existing one, will return INVALID_HANDLE if not found, should be called in OnAllPluginsLoaded).

FindConVar is a somewhat expensive operation, so you should cache the results.
Thanks
hamza47sohail is offline