đ˛cvar
Last updated
Last updated
cvar_object:call(...)
Name | Type | Description |
---|---|---|
Executes a ConCommand or cvar callback, passing its arguments to it.
cvar_object:int():
number
Gets or sets the ConVar int value.
cvar_object:float():
number
Gets or sets the ConVar float value.
cvar_object:string([ value: any ]):
string
Gets or sets the ConVar string value.
You can access the cvar_object
, old_value
and new_value
by adding them to the function arguments.
cvar_object:set_callback(callback: function)
Registers the callback to the specified ConVar/Command. The registered function will be called every time the specified convar value is updated.
cvar_object:unset_callback(callback: function)
Unregisters the callback that was set via the :set_callback
function from the specified ConVar/Command.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
...
Arguments passed to the callback
value
number
New int value
raw
boolean
Optional. If true
then the raw
value will be set
value
number
New float value
raw
boolean
Optional. If true
then the raw
value will be set
value
any
New string value. If not specified then returns the string value of the ConVar
callback
function
Lua function to call
callback
function
Lua function that was passed to the :set_callback
function