RedM Natives

GET_EXTERNAL_KVP_INT

A getter for SET_RESOURCE_KVP_INT, but for a specified resource.

Hash0x12B8D689
Runtime nameGetExternalKvpInt
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

int GET_EXTERNAL_KVP_INT(char* resource, char* key);

Parameters

NameTypeDescription
resourcechar*

The resource to fetch from.

keychar*

The key to fetch

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

Description

Cfx.re native reference

A getter for SET_RESOURCE_KVP_INT, but for a specified resource.

Usage

Lua
local retval = GetExternalKvpInt(resource, key)

-- always works, by hash
local retval = Citizen.InvokeNative(0x12b8d689, resource, key, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetExternalKvpInt(resource, key);

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

Examples

LUA · Cfx.re native reference
local kvpValue = GetExternalKvpInt('food', 'bananabread') 
if kvpValue then
	-- do something!
end

Sources

Cfx.re native reference

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