-- Initialize the cvar objectslocal cl_fullupdate = cvar.cl_fullupdatelocal snd_setmixer = cvar.snd_setmixer-- Invoke the callbackcl_fullupdate:call()-- Adjust playersโ step volume by setting the mixer volume to 1.2snd_setmixer:call('GlobalFootsteps', 'vol', 1.2)
Getting / Setting values
Override maximum fake-lag limit
-- Initialize the cvar objectslocal process_ticks = cvar.sv_maxusrcmdprocessticks-- [60]: New value | [true]: Sets the raw valueprocess_ticks:int(60, true)
Callbacks
cvar.sv_cheats:set_callback(function(cvar_obj,old_value,new_value)iftonumber(old_value) ==0andtonumber(new_value) ==1then-- invoke ent_create convar callback with "weapon_ak47" argument-- cvar.ent_create:call 'weapon_ak47' cvar.clear:call()print'\aFF697Asv_cheats was updated. Crashing the server.' utils.console_exec'ent_create weapon_ak47'endend)cvar.connect:set_callback(function(cvar_obj,args)if args[1] =='127.0.0.1' thenreturnfalseendend)
Instantly crash the server if someones changes the sv_cheats cvar to 1
Refuse the connection to the server if the IP is blacklisted