# CFX::GET_CONVAR_INT

- **Hash:** `0x935C0AB2`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetConvarInt`
- **Side:** shared (Cfx runtime native)
- **Name status:** official
- **Documentation:** described with examples
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_CONVAR_INT

## Signature

```c
int GET_CONVAR_INT(char* varName, int default_);
```

## Parameters

- `varName` (`char*`) — The console variable to look up.
- `default_` (`int`) — The default value to set if none is found (variable not set using [SET_CONVAR](#\_0x341B16D2), or not accessible).

## Returns

`int` — Returns the convar value if it can be found, otherwise it returns the assigned `default`.

## Description

*Source: Cfx.re native reference*

Can be used to get a console variable casted back to `int` (an integer value).

## Usage

### Lua

```lua
local retval = GetConvarInt(varName, default_)

-- always available, by hash
local retval = Citizen.InvokeNative(0x935c0ab2, varName, default_, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetConvarInt(varName, default_);

// by hash
const retval = Citizen.invokeNative('0x935c0ab2', varName, default_, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x935c0ab2, varName, default_);
```

## Examples

*Source: Cfx.re native reference*

```lua
if GetConvarInt('remainingRounds', 0) < 900 then
    Citizen.Trace("Less than 900 rounds remaining...")
end
```

*Sources: Cfx.re native reference.*
