Thread: cvar help.
View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-11-2014 , 09:29   Re: cvar help.
Reply With Quote #2

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.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-11-2014 at 09:32.
Powerlord is offline