GET_CONVAR_BOOL
Can be used to get a console variable casted back to bool.
Signature
BOOL GET_CONVAR_BOOL(char* varName, BOOL defaultValue);Parameters
| Name | Type | Description |
|---|---|---|
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
Can be used to get a console variable casted back to bool.
Usage
local retval = GetConvarBool(varName, defaultValue)
-- always works, by hash
local retval = Citizen.InvokeNative(0x7e8ebfe5, varName, defaultValue, Citizen.ReturnResultAnyway())JavaScript and C#
const retval = GetConvarBool(varName, defaultValue);
// by hash
const retval = Citizen.invokeNative('0x7e8ebfe5', varName, defaultValue, Citizen.returnResultAnyway());bool retval = Function.Call<bool>((Hash)0x7e8ebfe5, varName, defaultValue);Examples
if GetConvarBool('dev_mode', false) then
print("Dev Mode is eanbled, load dev mode menus")
endSources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.