I've a question regarding register_cvar when running hlds.exe with the -console option. I have the code below and the value of my_cvar is initialised to what I specify when starting a HLDS instance (in +servercfgfile) but it's not picking it up when I start the server with -console.
Do I need to do something else when using the -console option? Using Metamod 1.91 and AMX Mod X 1.81.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "HLDS Plugin"
#define VERSION "0.1"
#define AUTHOR "Author"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("my_cvar", "0", FCVAR_SPONLY|FCVAR_SERVER)
log_message("mp_winlimit is %d", get_cvar_num("mp_winlimit"))
log_message("my_cvar is %d", get_cvar_num("my_cvar"))
}
public client_putinserver(id){
log_message("my_cvar is %d", get_cvar_num("my_cvar"))
return PLUGIN_CONTINUE
}