RedM Natives

GET_RESOURCE_METADATA

Gets the metadata value at a specified key/index from a resource's manifest.

Hash0x964BAB1D
Runtime nameGetResourceMetadata
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

char* GET_RESOURCE_METADATA(char* resourceName, char* metadataKey, int index);

Parameters

NameTypeDescription
resourceNamechar*

The resource name.

metadataKeychar*

The key in the resource manifest.

indexint

The value index, in a range from [0..GET_NUM_RESOURCE_METDATA-1].

Returns char*

Description

Cfx.re native reference

Gets the metadata value at a specified key/index from a resource's manifest. See also: Resource manifest

Usage

Lua
local retval = GetResourceMetadata(resourceName, metadataKey, index)

-- always works, by hash
local retval = Citizen.InvokeNative(0x964bab1d, resourceName, metadataKey, index, Citizen.ResultAsString())
JavaScript and C#
JavaScript
const retval = GetResourceMetadata(resourceName, metadataKey, index);

// by hash
const retval = Citizen.invokeNative('0x964bab1d', resourceName, metadataKey, index, Citizen.returnResultAnyway(), Citizen.resultAsString());
C#
string retval = Function.Call<string>((Hash)0x964bab1d, resourceName, metadataKey, index);

Sources

Cfx.re native reference

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