# CFX::GET_CONVAR_BOOL

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

## Signature

```c
BOOL GET_CONVAR_BOOL(char* varName, BOOL defaultValue);
```

## Parameters

- `varName` (`char*`) — The console variable to look up.
- `defaultValue` (`BOOL`) — The default value to set if none is found.

## Returns

`BOOL` — 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 `bool`.

## Usage

### Lua

```lua
local retval = GetConvarBool(varName, defaultValue)

-- always available, by hash
local retval = Citizen.InvokeNative(0x7e8ebfe5, varName, defaultValue, Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const retval = GetConvarBool(varName, defaultValue);

// by hash
const retval = Citizen.invokeNative('0x7e8ebfe5', varName, defaultValue, Citizen.returnResultAnyway());
```

### C#

```csharp
bool retval = Function.Call<bool>((Hash)0x7e8ebfe5, varName, defaultValue);
```

## Examples

*Source: Cfx.re native reference*

```lua
if GetConvarBool('dev_mode', false) then
    print("Dev Mode is eanbled, load dev mode menus")
end
```

*Sources: Cfx.re native reference.*
