View Single Post
Plugin Info:     Modification:          Category:         
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 02-15-2016 , 05:13   [Sven Co-op] Static.cfg restoration
Reply With Quote #1

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:
  • 1.0
    • Added a new cvar amx_static_filename, which allows you to use a different static file, useful if you run various servers that may need different configurations.
    • Small optimizations
  • 0.9
    • Tons of optimizations
  • 0.5
    • Cleaned up and optimized the plugin code
    • Fixed a logic error causing a Segmentation Fault in some maps
    • Implemented a Whitelist feature
  • 0.1B
    • Removed a couple of lines causing a redundancy
  • 0.1
    • Initial release

Instalation:
  • Install this plugin like any other
  • Download static.cfg file, edit it at your liking and then place it in your amxx/configs folder.

Cvars:
  • amx_static_check (default "0") - enforces the plugin to re-apply the static.cfg every n seconds. (to prevent map entities to change certain cvars) 0 to disable this feature.
  • amx_static_filename (default "static.cfg") - specifies which static configuration file to use. Useful if you run various servers that may need different configurations.
Credits:
  • fysiks - I used his Bot TK Apology plugin as a basis for the file read method and also helped me with the code
Attached Files
File Type: txt static_whitelist.txt (143 Bytes, 451 views)
File Type: cfg static.cfg (376 Bytes, 329 views)
File Type: sma Get Plugin or Get Source (static_cfg_restoration.sma - 1231 views - 5.1 KB)
__________________

Last edited by gabuch2; 07-13-2016 at 15:59.
gabuch2 is offline