Raised This Month: $51 Target: $400
 12% 

Multiple configs for statsx, misc.stats [AMXX1.8.0.3660]


Post New Thread Reply   
 
Thread Tools Display Modes
RPG
Senior Member
Join Date: Aug 2005
Old 07-27-2008 , 13:16   Re: Multiple configs for statsx, misc.stats [AMXX1.8.0.3660]
Reply With Quote #11

OK this is what I mentioned.
no matter what CFG you ON it loads a stats-csdm.ini, no more stats.ini.
If I change some settings the star (*) appiers near Save configuration, but after trying to save it, NO save confirmation appears, just hide the menu.
And if you look again to stats, "Save configuration" shows still with (*), even I nothing have change in 2nd or 3rd look. Only after mapchange star (*) disappear but stats configuration still in 1st situation.
It's doesn't write configuration to the stats file.
RPG is offline
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 07-28-2008 , 03:52   Re: Multiple configs for statsx, misc.stats [AMXX1.8.0.3660]
Reply With Quote #12

If it's linux - make sure the file stats-csdm.ini has acess rights to write poperties to it the same like for stats.ini (it cannot be read only and it has to have full access rights).
Post also Your full path to that file (I'm not sure if default 64 characters is enough in Your case).
__________________
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.
KWo is offline
RPG
Senior Member
Join Date: Aug 2005
Old 07-28-2008 , 08:20   Re: Multiple configs for statsx, misc.stats [AMXX1.8.0.3660]
Reply With Quote #13

No it's win32 and it's NOT read-only.
Full path will be: c:\hlserver pub\cstrike\addons\amxmodx\configs\stats-csdm.ini
Looks like 62 characters.

I think it's code error, NOT other things.
Have you tried this modified statscfg plugin?

Or maybe I can try Lee method, can you show where I need to add line:
Code:
public csdm_Init()     
         csdm_StateChange(1)
And what else to comment.

Last edited by RPG; 07-28-2008 at 16:50.
RPG is offline
RPG
Senior Member
Join Date: Aug 2005
Old 07-28-2008 , 16:16   Re: Multiple configs for statsx, misc.stats [AMXX1.8.0.3660]
Reply With Quote #14

This is what I found in error log after enabling debug on statscfg.amxx

Code:
L 07/28/2008 - 22:43:31: Start of error session.
L 07/28/2008 - 22:43:31: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20080728.log")
L 07/28/2008 - 22:43:31: Couldn't write file "cstrike\"
L 07/28/2008 - 22:43:31: [AMXX] Displaying debug trace (plugin "statscfg.amxx")
L 07/28/2008 - 22:43:31: [AMXX] Run time error 10: native error (native "write_file")
L 07/28/2008 - 22:43:31: [AMXX]    [0] statscfg.sma::saveSettings (line 263)
L 07/28/2008 - 22:43:31: [AMXX]    [1] statscfg.sma::actionCfgMenu (line 233)
and statscfg looks:
Code:
.
.
.
.
.

public actionCfgMenu(id, key)
{
	switch (key)
	{
		case 7:
		{
			if (saveSettings(g_fileToSave))  // Line 233
			{
				g_modified = false
				client_print(id, print_chat, "* %L", id, "STATS_CONF_SAVED")
			}
			else
				client_print(id, print_chat, "* %L", id, "STATS_CONF_FAILED")
			
			displayCfgMenu(id, g_menuPosition[id])
		}
		case 8: displayCfgMenu(id, ++g_menuPosition[id])
		case 9: displayCfgMenu(id, --g_menuPosition[id])
		default:
		{
			g_modified = true
			new a = g_menuPosition[id] * 7 + key
			set_xvar_num(g_menuDataId[a], 1 - get_xvar_num(g_menuDataId[a]))
			
			displayCfgMenu(id, g_menuPosition[id])
		}
	}
	
	return PLUGIN_HANDLED
}


.
.
.
.
.
.


saveSettings(filename[])
{
	if (file_exists(filename))
		delete_file(filename)
	
	if (!write_file(filename, ";Generated by Stats Configuration Plugin. Do not modify!^n;Variable  Description"))  // Line 263
		return 0
	
	new text[256]
	
	for (new a = 0; a < g_menuDataNum; ++a)
	{
		if (get_xvar_num(g_menuDataId[a]))
		{
			if (equal(g_menuData[a], "ST_", 3))
			{
				format(text, 255, "%-24.23s ;%L", g_menuDataVar[a], LANG_SERVER, g_menuData[a])
			}
			else
			{
				format(text, 255, "%-24.23s ;%s", g_menuDataVar[a], g_menuData[a])
			}
			write_file(filename, text)
		}
	} 
	
	return 1
}

.
.
.
.
.
RPG is offline
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 07-28-2008 , 17:57   Re: Multiple configs for statsx, misc.stats [AMXX1.8.0.3660]
Reply With Quote #15

That means g_fileToSave is not filled up correctly (since You have an empty string). Filling it up in plugin_init was too late (You could see that before - all the time stats.ini was loaded). But there is no any good place for that...
We can try to go back to load it again in plugin_init, but with one modification more...
Code:
public plugin_init()
{
	register_plugin("Stats Configuration", AMXX_VERSION_STR, "AMXX Dev Team")
	register_menucmd(register_menuid("Stats Configuration"), 1023, "actionCfgMenu")
	if (!csdm_active())
	{
		get_configsdir(g_fileToSave, 63)
		format(g_fileToSave, 63, "%s/stats.ini", g_fileToSave)
		loadSettings(g_fileToSave)
	}
	g_coloredMenus = colored_menus()
}
I hope that will solve Your problem...
__________________
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.
KWo is offline
RPG
Senior Member
Join Date: Aug 2005
Old 07-29-2008 , 16:29   Re: Multiple configs for statsx, misc.stats [AMXX1.8.0.3660]
Reply With Quote #16

Now it's loads correct stats file , depending what mode you ON.
But there is one but:
It's fine if you changing stats configuration in NORMAL server mode.
You get "Stats configuration saved successfully" on choosing 8. Save configuration.
Entering again to stats, no "*" star near "Save configuration".
After mapchange everything keeps saved like you changed.

There is problem then you chose CSDM server mode.
Now it's loads stats-csdm.ini but still:
1. NO "Stats configuration saved successfully" on choosing to save.
2. Entering again to stats menu "*" still near 8. Save configuration
3. After mapchange stats-csdm.ini loads NOT changed configuration.

And log:
Code:
L 07/29/2008 - 23:23:35: Start of error session.
L 07/29/2008 - 23:23:35: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20080729.log")
L 07/29/2008 - 23:23:35: Couldn't write file "cstrike\"
L 07/29/2008 - 23:23:35: [AMXX] Displaying debug trace (plugin "statscfg.amxx")
L 07/29/2008 - 23:23:35: [AMXX] Run time error 10: native error (native "write_file")
L 07/29/2008 - 23:23:35: [AMXX]    [0] statscfg.sma::saveSettings (line 265)
L 07/29/2008 - 23:23:35: [AMXX]    [1] statscfg.sma::actionCfgMenu (line 235)
Still errors on same lines.
RPG is offline
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 07-30-2008 , 03:52   Re: Multiple configs for statsx, misc.stats [AMXX1.8.0.3660]
Reply With Quote #17

Could You , please change for test the name of the file "stats-csdm.ini" to "stats_c.ini" (and also in the function below):
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) 
}
__________________
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.
KWo is offline
RPG
Senior Member
Join Date: Aug 2005
Old 07-30-2008 , 08:21   Re: Multiple configs for statsx, misc.stats [AMXX1.8.0.3660]
Reply With Quote #18

Nothing, still the same and still the same error log.
Also I tried to write some configuration manually to stats_c.ini, but on CSDM mode it's loads configuration with all positions OFF, even stats_c.ini is with some of the stats ON.
Looks like it's NOT loading the stats_c.ini file.
RPG is offline
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 07-30-2008 , 08:53   Re: Multiple configs for statsx, misc.stats [AMXX1.8.0.3660]
Reply With Quote #19

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) 
	log_amx("[DEBUG] Statscfg - CSDM state %d", csdm_state)
}
Add this line (log_amx) and check what is happening when You are changing the state of CSDM. I mean look into addons\amxmodx\logs (log files of AMX X) to see if that is whole executed or not...
__________________
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.
KWo is offline
RPG
Senior Member
Join Date: Aug 2005
Old 07-31-2008 , 16:46   Re: Multiple configs for statsx, misc.stats [AMXX1.8.0.3660]
Reply With Quote #20

OK I tested it.
If statscfg.amxx without "debug" log:
Code:
L 07/31/2008 - 23:23:09: Start of error session.
L 07/31/2008 - 23:23:09: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20080731.log")
L 07/31/2008 - 23:23:09: Couldn't write file "cstrike\"
L 07/31/2008 - 23:23:09: [AMXX] Run time error 10 (plugin "statscfg.amxx") (native "write_file") - debug not enabled!
L 07/31/2008 - 23:23:09: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
If statscfg.amxx with "debug" log:
Code:
L 07/31/2008 - 23:34:39: Start of error session.
L 07/31/2008 - 23:34:39: Info (map "de_dust") (file "addons/amxmodx/logs/error_20080731.log")
L 07/31/2008 - 23:34:39: Couldn't write file "cstrike\"
L 07/31/2008 - 23:34:39: [AMXX] Displaying debug trace (plugin "statscfg.amxx")
L 07/31/2008 - 23:34:39: [AMXX] Run time error 10: native error (native "write_file")
L 07/31/2008 - 23:34:39: [AMXX]    [0] statscfg2.sma::saveSettings (line 265)
L 07/31/2008 - 23:34:39: [AMXX]    [1] statscfg2.sma::actionCfgMenu (line 235)
RPG is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode