In the end I got it working like this.
Code:
enum convars
{
ConVar:cvar1,
ConVar:cvar2,
ConVar:cvar3,
ConVar:cvar4
};
ConVar g_cvar[convars];
I wanted to loop through all my convars on plugin start, check if they are null then add change hooks to each of them. But I can't seem to find enum documentation anywhere; specially to get the size of the enum, so I just added length as my best guess.
Code:
public OnPluginStart()
{
g_cvar[cvar1] = CreateConVar("sm_cvar_one", "1", "description here);
g_cvar[cvar2] = CreateConVar("sm_cvar_two", "1", "description here);
g_cvar[cvar3] = CreateConVar("sm_cvar_three", "1", "description here);
g_cvar[cvar4] = CreateConVar("sm_cvar_four", "1", "description here);
for (new cIDX = 0; cIDX < convars.length; cIDX++)
{
if(g_cvar[cIDX] != null)
{
g_cvar[cIDX].AddChangeHook(OnConvarChanged);
}
}
}