Raised This Month: $32 Target: $400
 8% 

Force AutoExecConfig() to create cfg in late


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 10-28-2018 , 09:12   Force AutoExecConfig() to create cfg in late
Reply With Quote #1

Hi,

I do like to use sm engine to update convar values in cfg file.

Unfortunately:

Code:
char g_sConfigFile[30] = "l4d_test_plugin";

public void OnPluginStart()
{
    AutoExecConfig(true, g_sConfigFile);
}
is work, but calling:
Code:
void UpdateCfg()
{
	char sPath[PLATFORM_MAX_PATH];
	Format(sPath, sizeof(sPath), "cfg/sourcemod/%s.cfg", g_sConfigFile);
	DeleteFile(sPath);
	AutoExecConfig(true, g_sConfigFile);
}
in late game is not work: file deleted but not created.

Is it possible to force it to work rather than writing code like this or creating own config file, like KeyValues format? (I don't want to produce extra cfg files or extra code.)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 10-28-2018 , 11:18   Re: Force AutoExecConfig() to create cfg in late
Reply With Quote #2

You can't reasonably do this yourself without examining the config contents. Just deleting the file would lose any changes the user has made. Even if you find code written to do this for you (which I'm pretty sure someone has done, but I don't think it's popular), you'll have to at least give it your variable names, so it'd involve a code change.

Last edited by Fyren; 10-28-2018 at 11:19.
Fyren is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 10-28-2018 , 11:48   Re: Force AutoExecConfig() to create cfg in late
Reply With Quote #3

https://forums.alliedmods.net/showthread.php?t=204254
__________________
coding & free software
shanapu is offline
Reply


Thread Tools
Display Modes

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 14:24.


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