- Documentation
- Server functions
- setServerConfigSetting
Function
setServerConfigSetting
A function for changing a setting in the server configuration file.
Syntax
bool setServerConfigSetting(string name, string value [, bool save = false])Arguments
namestring- Setting name.
valuestring- Value.
savebool, optional = false- Save to disk.
Returns
Always false in this version (with a warning).
Example
if not setServerConfigSetting("max_slots", "100") then setMaxPlayers(100) end
Notes
Limitation. Changing the configuration from a script is blocked; use setMaxPlayers and setServerPassword at runtime.
See also
getServerConfigSettingA function for reading a setting from the server configuration file.setMaxPlayersChanges the number of server slots at runtime (1-65535). New players are rejected when the server is full; current ones are not kicked. The change lasts until the server restarts.setServerPasswordSets or removes the server password at runtime. The server immediately requires the password from new players; the launcher gets the new password with the next server list report (up to 30 seconds) - until then entering the new password may fail. Players already on the server are not kicked.nil/falseremoves the password.