RedM Natives

GET_STATE_BAG_KEYS

Hash0x78D864C7
Runtime nameGetStateBagKeys
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

object GET_STATE_BAG_KEYS(char* bagName);

Parameters

NameTypeDescription
bagNamechar*

The name of the bag.

Returns object — Returns an array containing all keys for which the state bag has associated values.

Usage

Lua
local retval = GetStateBagKeys(bagName)

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

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

Sources

Cfx.re native reference

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