RedM Natives

GET_STATE_BAG_VALUE

Returns the value of a state bag key.

Hash0x637F4C75
Runtime nameGetStateBagValue
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

object GET_STATE_BAG_VALUE(char* bagName, char* key);

Parameters

NameTypeDescription
bagNamechar*—
keychar*—

Returns object — Value.

Description

Cfx.re native reference

Returns the value of a state bag key.

Usage

Lua
local retval = GetStateBagValue(bagName, key)

-- always works, by hash
local retval = Citizen.InvokeNative(0x637f4c75, bagName, key, Citizen.ResultAsObject2(msgpack.unpack))
JavaScript and C#
JavaScript
const retval = GetStateBagValue(bagName, key);

// by hash
const retval = Citizen.invokeNative('0x637f4c75', bagName, key, Citizen.returnResultAnyway(), Citizen.resultAsObject2());
C#
Function.Call((Hash)0x637f4c75, bagName, key);

See also

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.