Garry's Mod Wiki

server_cvar

Description

Called when a convar with FCVAR_NOTIFY is changed on the server.

Parameters

string cvarname
The convar name. e.g "sv_cheats".
string cvarvalue
The new value. Always a string. e.g "1".

Examples

Example

This is a basic template with the purpose of including all arguments / table variables to make it easily known which values can be accessed.

gameevent.Listen( "server_cvar" ) hook.Add( "server_cvar", "server_cvar_example", function( data ) local cvarname = data.cvarname // The convar name local cvarvalue = data.cvarvalue // The new value // Called when a convar with FCVAR_NOTIFY is changed on the server. end )