Well - csdmStateChange got called after changing CSDM state everytime, but... if after that changelevel got called, - the sate of CSDM wasn't chnaged, so it wasn't called on the new map start, so the string (filename) wasn't filled up at all...
Here is the version which should definitevely solve Your problems (tested by me and it was working on me).
Code:
public plugin_init()
{
register_plugin("Stats Configuration", AMXX_VERSION_STR, "AMXX Dev Team")
register_menucmd(register_menuid("Stats Configuration"), 1023, "actionCfgMenu")
get_configsdir(g_fileToSave, 63)
format(g_fileToSave, 63, "%s/stats%s.ini", g_fileToSave, csdm_active() ? "_c" : "") // here is the main change...
loadSettings(g_fileToSave)
g_coloredMenus = colored_menus()
}
The rest was OK, I mean that should stay like it was (just without amx_log line).
Code:
public csdm_StateChange(csdm_state)
{
if(csdm_state > 1)
return
get_configsdir(g_fileToSave, 63)
format(g_fileToSave, 63, "%s/stats%s.ini", g_fileToSave, csdm_state ? "_c" : "")
loadSettings(g_fileToSave)
}
I'm very sorry I haven't had time to test it before, but I was heavilly working on the new ChickenMod Orange Edition version (internal beta tests phase).
The Fullpack of podbot mm
V3B22 - 24 apr 2012!!! is available
here.
The All-In-One 3.2a package - 02 jun 2013 (
AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available
here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available
here.