RedM Index logoRedM Index
NativesHashesClothesBlipsPropsItem Tool
Sign inGet started

Reference

  • Natives
  • Hashes
  • Clothes
  • Blips
  • Props

Namespace

  1. Reference
  2. Natives
  3. ADD_CONVAR_CHANGE_LISTENER

ADD_CONVAR_CHANGE_LISTENER

Adds a listener for Console Variable changes. The function called expects to match the following signature: ```ts function ConVarChangeListener(conVarName: string, reserved: any); ``` * **conVarName**: The ConVar that changed. * **reserved**: Currently unused.

CFX

Signature

lua
AddConvarChangeListener(conVarFilter, handler)
-- returns int

Parameters

NameTypeDescription
char*The Console Variable to listen for, this can be a pattern like "test:\*", or null for any
funcThe handler function.

Usage

Named call
AddConvarChangeListener(conVarFilter, handler)
InvokeNative
Citizen.InvokeNative(0xAB7F7241, conVarFilter, handler)
js 1
// 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))
})

Details

Hash
API set
Source
cfx

Source: cfx

On this page

  • Signature
  • Parameters
  • Usage
  • Details