[Sven Co-op] Static.cfg restoration
3 Attachment(s)
When Sven Co-op 4 was released, the devs implemented a new feature called static.cfg, in which server owners could define specific cvars without worrying that maps could replace them.
This feature was removed in Sven Co-op 5 so I made this simple plugin to restore the file functionality while also including new features, like a map whitelist or the power to edit weaponmodes (you couldn't edit weaponmodes with static.cfg back in SC4). Add weaponmode_shotgun 1 to the static.cfg file and your server will have the classic shotgun in all the maps! :D Tested, and made for Sven Co-op 5. Technically it may work in other mods but it's not really needed since those can't override their server.cfg settings. Whitelisting maps: This plugin allows you to whitelist maps, the plugin will not apply the static values on maps inside the static_whitelist.txt file. The reason of this? Sometimes a map will break if you try to override its variables (overriding the sv_gravity value in the map phobia makes the map unplayable, since you depend on the special gravity setting) Changelog:
Instalation:
Cvars:
|
Re: Static.cfg restoration
Updated
|
Re: Static.cfg restoration
|
Re: Static.cfg restoration
1 Attachment(s)
Quote:
I also forgot to credit you fysiks, since I used your bot apology plugin as a basis for the file read method. |
Re: Static.cfg restoration
I did that plugin a long time ago and have learned to do things more elegantly/properly. I would change these lines:
PHP Code:
PHP Code:
You forgot this: Quote:
|
Re: Static.cfg restoration
Updated!
|
Re: Static.cfg restoration
does it works for specific "cvar"? like startarmor?
|
Re: Static.cfg restoration
Quote:
Are the cvars 'startarmor', 'starthealth', 'maxarmor' and 'maxhealth' inputable in the server console? If the answer is yes, then yes! They will work with static.cfg I never tried with these cvars so I do not know if they work. |
Re: Static.cfg restoration
1.get_mapname(currentmap, 32) this is wrong. The last item from a string array should be the null terminator, so you need to use 32 - 1 as buffer size. Also, instead of hardcoding the dimension, use charsmax() to retrieve it. Also replace your sizeof -1 with charsmax(), for readability.
2.If map is on whitelist pause the plugin. 3.In VerifyWhitelist:
Here is how you should hook it: PHP Code:
To block the change, simply do return okapi_ret_supercede. |
Re: Static.cfg restoration
Thank you for reviewing the plugin! It helped me to understand more things.
You're pretty much right about every point but I have to disagree with this one Quote:
I also have some questions. Quote:
Quote:
|
All times are GMT -4. The time now is 22:13. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.