| Property | Value |
|---|---|
| Native Name | ADD_CONVAR_CHANGE_LISTENER |
| Hash | 0xAB7F7241 |
| Return Type | int |
| API Set | shared |
| Parameters | conVarFilter (char*), handler (func) |
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
conVarFilter(char*) — The Console Variable to listen for, this can be a pattern like "test:*", or null for anyhandler(func) — The handler function.
Examples
// 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))
})