Garry's Mod Wiki

UpdateServerSettings

  UpdateServerSettings()

Description

This is used internally - although you're able to use it you probably shouldn't. Called from JS when starting a new game

Updates the Server Settings when called.

Example

Updating the Server Setting manually

if !pnlMainMenu then return end -- pnlMainMenu is the Main Menu panel. (https://github.com/Facepunch/garrysmod/blob/master/garrysmod/lua/menu//garrysmod/lua/menu/mainmenu.lua#L468) local settings = { hostname = "Example", sv_lan = 0, p2p_enabled = 1, } pnlMainMenu:Call( "UpdateServerSettings(" .. util.TableToJSON( settings ) .. ")" )
Output:
Only the given settings will be displayed and the gamemode settings will be hidden!