2 Replies Latest reply: Jul 22, 2011 5:39 PM by ignomo RSS

unlimited dvars trick

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
exec server.cfg
setmoddvar set -remove

Add dvartrick.cfg to the mod fastfile:

When the dedicated server starts, execute the config:
/exec dvartrick.cfg

This will:
- 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.