Open azalty opened 1 year ago
Apart from that, implementing kidfearless' convar include could be useful, as it would allow for longer convar descriptions, and auto-refreshing of the cvars file (instead of having to regenerate it).
Auto-exec config has its drawbacks, being that you can't update or remove cvars with it, but only add some. (which isn't the case with kidfearless' Auto-Exec-Config-Class)
Implementing kidfearless' thing might require some changes to the code however. We could keep the current caching system if we're lazy.
Found bugs with this PR, currently testing and fixing
Seems to be working from my limited testing. I advise testing by yourselves
This PR makes commands customizable through cvars. Not sure if not updating the .cfg file could be a problem, or if the plugin would just use the default values in this case.
Up to 10 commands are allowed for each command callback (store, inventory...), each command having a maximum length of 60 bytes. Feel free to modify that if you want to.
The zephstocks.inc's cvar value max string size was doubled (128 -> 256) in order to allow more commands.
This change could break plugins that try to run store commands through the console (with
ServerCommand()
) before configs are loaded, and on the initial load. It is a very specific case, but I guess it could happen, so I'm warning anyway.This PR implies big changes and should be heavily tested before it is accepted as it could break other things, and render the plugin unusable (if bugged).
✅ Compiles fine ✅ Tested in game, and working