[INC] Append new ConVars to plugin config v2.1
1 Attachment(s)
Ciao,
I made a simple replacement for AutoExecConfig ;-) PHP Code:
Note: You will see all your ConVars on server console when is config updating. Implementing:
Note: AutoExecConfigAppend will log message about appending ConVars to SourceMod logs. Important note: If AutoExecConfigAppend do not append all ConVars, change "#define CONVAR_APPEND_MAXCHARS 4096" to higher value (in convar_append.inc line 7).Example:
Spoiler
Against my testing, there might be some bugs.. So let me know if you find someone please. Change log:
Spoiler
|
Re: [INC] Append new ConVars to plugin config
What's the different between this and the one Impact123 wrote?
|
Re: [INC] Append new ConVars to plugin config
You don't need to use special functions for creating ConVars etc.. This is easier to use.
|
Re: [INC] Append new ConVars to plugin config
Couldn't you just load the configuration file, delete it and then let AutoExecConfig create it again ?
This way it should add all Cvars automatically and would be just a few lines of code. |
Re: [INC] Append new ConVars to plugin config
the point of a configuration file is to save the configuration, not to delete it... It will put all cvars to default values which is unwanted but your idea it not totally wrong but would still need a new AutoExecConfig external since my idea was to load the cvars, delete old configs, and create new one (from scratch and not from sourcemod) to add the cvars at their current values plus the new cvars.
|
Re: [INC] Append new ConVars to plugin config
And even if the new file generated by AutoExecConfig saved the current values rather than the defaults... Deleting the file would remove any comments that the server op may have placed in there.
|
Re: [INC] Append new ConVars to plugin config
Quote:
I haven't find anything in the documentation, that the default values are used instead of the current ones, but yeah it of course doesn't work then. It was just an idea how to maybe get away with less code. Quote:
|
Re: [INC] Append new ConVars to plugin config
Quote:
|
Re: [INC] Append new ConVars to plugin config
What's wrong with commenting configs?
If this saved new values in your cfg instead of making them default again, I'd use it! Unless it already does, and I just misread. |
Re: [INC] Append new ConVars to plugin config
I plan to make a better and smarter version after my exams, this is a little messy version.. O:-)
|
All times are GMT -4. The time now is 13:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.