Well for instance .. if you wanted to create a CVAR in a hack in the public sources around here... heres an example
PHP:--------------------------------------------------------------------------------
You just add the desired cvar name next to 'cvar.'
//========
if (cvar.aswitch == 1) {
cmd.exec("alias sigswitch #slot2");
else {
cmd.exec("alias sigswitch");
}
}
//=========
Once you write your code like that you need to register it in the 'CVARList'. This can be located in the cvar.cpp & cvar.h..
IN CVAR.CPP
cvarname , default value
//=========
REGISTER_CVAR_INT( aswitch ,1)
//=========
IN CVAR.H
//=========
int aswitch;
//=========