RedM Natives

GET_NUM_RESOURCE_METADATA

Gets the amount of metadata values with the specified key existing in the specified resource's manifest.

Hash0x776E864
Runtime nameGetNumResourceMetadata
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

int GET_NUM_RESOURCE_METADATA(char* resourceName, char* metadataKey);

Parameters

NameTypeDescription
resourceNamechar*

The resource name.

metadataKeychar*

The key to look up in the resource manifest.

Returns int

Description

Cfx.re native reference

Gets the amount of metadata values with the specified key existing in the specified resource's manifest. See also: Resource manifest

Usage

Lua
local retval = GetNumResourceMetadata(resourceName, metadataKey)

-- always works, by hash
local retval = Citizen.InvokeNative(0x776e864, resourceName, metadataKey, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetNumResourceMetadata(resourceName, metadataKey);

// by hash
const retval = Citizen.invokeNative('0x776e864', resourceName, metadataKey, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0x776e864, resourceName, metadataKey);

Sources

Cfx.re native reference

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