This method will allow modders to give admins more than 256 dvars and admins a way to set all the dvars from a config file.
Put in a config: dvartrick.cfg
if ( dvarfloat( ui_animSpeedScale ) == 0 ) setmoddvar set
setmoddvar set -remove
Add dvartrick.cfg to the mod fastfile:
When the dedicated server starts, execute the config:
- Whitelist 'set' if it's a dedicated server
- Execute server.cg
- Blacklist 'set'
In server.cfg admins can set any number of dvars using 'set dvarname [value]'
- The if keyword is followed by a space and the predicate is between brackets. The whole statement is in one line.
- The dvar ui_animspeedscale does not exist in dedicated servers, so the predicate is true. The dvar is client side and can not be set to zero. This prevents clients from using this method to whitelist their own dvars.