RedM Natives

STATE_BAG_HAS_KEY

Hash0x12A330
Runtime nameStateBagHasKey
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

bool STATE_BAG_HAS_KEY(char* bagName, char* key);

Parameters

NameTypeDescription
bagNamechar*

The name of the bag.

keychar*

The key used to check data existence.

Returns bool — Returns true if the data associated with the specified key exists; otherwise, returns false.

Usage

Lua
local retval = StateBagHasKey(bagName, key)

-- always works, by hash
local retval = Citizen.InvokeNative(0x12a330, bagName, key, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const retval = StateBagHasKey(bagName, key);

// by hash
const retval = Citizen.invokeNative('0x12a330', bagName, key, Citizen.returnResultAnyway());
C#
bool retval = Function.Call<bool>((Hash)0x12a330, bagName, key);

Sources

Cfx.re native reference

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