RedM Natives

GET_RESOURCE_KVP_STRING

A getter for SET_RESOURCE_KVP.

Hash0x5240DA5A
Runtime nameGetResourceKvpString
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

char* GET_RESOURCE_KVP_STRING(char* key);

Parameters

NameTypeDescription
keychar*

The key to fetch

Returns char* — The string value stored under the specified key, or nil/null if not found.

Description

Usage

Lua
local retval = GetResourceKvpString(key)

-- always works, by hash
local retval = Citizen.InvokeNative(0x5240da5a, key, Citizen.ResultAsString())
JavaScript and C#
JavaScript
const retval = GetResourceKvpString(key);

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

Examples

LUA · Cfx.re native reference
local kvpValue = GetResourceKvpString('codfish') 
if kvpValue then
	-- do something!
end

Sources

Cfx.re native reference

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