Code:
#include <amxmodx>
// In that file should be writen the CVar ant its value, like "amx_ffff 1"
new ExecFilePath[] = "addons/New Folder/config.cfg";
new MyVar;
public plugin_init()
{
MyVar = register_cvar("amx_ffff", "1"); // 1 - on, 0 - off
server_cmd("exec ^"%s^"", ExecFilePath);
}
public SomeFunc()
{
if (get_pcvar_num(MyVar))
{
// Do stuff if MyVar is enabled
}
else
{
// Do stuff if MyVar is disabled
}
}
__________________