STATE_BAG_HAS_KEY
Signature
bool STATE_BAG_HAS_KEY(char* bagName, char* key);Parameters
| Name | Type | Description |
|---|---|---|
bagName | char* | The name of the bag. |
key | char* | The key used to check data existence. |
Returns bool — Returns true if the data associated with the specified key exists; otherwise, returns false.
Usage
local retval = StateBagHasKey(bagName, key)
-- always works, by hash
local retval = Citizen.InvokeNative(0x12a330, bagName, key, Citizen.ReturnResultAnyway())JavaScript and C#
const retval = StateBagHasKey(bagName, key);
// by hash
const retval = Citizen.invokeNative('0x12a330', bagName, key, Citizen.returnResultAnyway());bool retval = Function.Call<bool>((Hash)0x12a330, bagName, key);Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.