RedM Natives

GET_EXTERNAL_KVP_STRING

A getter for SET_RESOURCE_KVP, but for a specified resource.

Hash0x9080363A
Runtime nameGetExternalKvpString
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

char* GET_EXTERNAL_KVP_STRING(char* resource, char* key);

Parameters

NameTypeDescription
resourcechar*

The resource to fetch from.

keychar*

The key to fetch

Returns char* — A string that contains the value stored in the Kvp or nil/null if none.

Description

Cfx.re native reference

A getter for SET_RESOURCE_KVP, but for a specified resource.

Usage

Lua
local retval = GetExternalKvpString(resource, key)

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

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

Examples

LUA · Cfx.re native reference
local kvpValue = GetExternalKvpString('food', '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.