AddConvarChangeListener
Docslocal retval = AddConvarChangeListener(conVarFilter, handler)Description
Adds a listener for Console Variable changes.
The function called expects to match the following signature:
function ConVarChangeListener(conVarName: string, reserved: any); conVarName: The ConVar that changed.
reserved: Currently unused.
Parameters
| Name | Type | Description |
|---|---|---|
conVarFilter | char* | The Console Variable to listen for, this can be a pattern like "test:\*", or null for any |
handler | func | The handler function. |
Returns
intReturns an integer value.
Examples
Official
// listen for all convar changes
AddConvarChangeListener(null, (conVarName, reserved) => {
print(GetConvarInt(conVarName))
})
// listen to convars that start with "script:"
AddConvarChangeListener("script:*", (conVarName, reserved) => {
print(GetConvarInt(conVarName))
})