During the init of a plugin, I would like to get two values from a file, (abc.cfg) under amx conf directory.
Code:
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
//deffault value
register_cvar("ip_common", "127.0.0.1")
new configsDir[64], HostIP[32]
get_configsdir(configsDir, 63)
server_cmd("exec %s/abc.cfg", configsDir)
get_cvar_string("ip_common",HostIP,31)
}
In the addons\amxmodx\configs\abc.cfg, I have:
Code:
ip_common "210.245.126"
My understanding for
server_cmd("exec %s/abc.cfg", configsDir) is to assign the value to the the registered VAR. I follow AMX admin.sma in which it has default MySQL parameters and it also reads the setting from sql.cfg.
However, it always returns me the default value, 127.0.0.1
I went throught the tutorial, but no good news. Thanks for any suggestions.