RedM Natives

START_FIND_EXTERNAL_KVP

Equivalent of START_FIND_KVP, but for another resource than the current one.

Hash0x8F2EECC3
Runtime nameStartFindExternalKvp
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

int START_FIND_EXTERNAL_KVP(char* resourceName, char* prefix);

Parameters

NameTypeDescription
resourceNamechar*

The resource to try finding the key/values for

prefixchar*

A prefix match

Returns int — A KVP find handle to use with [FIND_KVP](#\_0xBD7BEBC5) and close with [END_FIND_KVP](#\_0xB3210203)

Description

Cfx.re native reference

Equivalent of START_FIND_KVP, but for another resource than the current one.

Usage

Lua
local retval = StartFindExternalKvp(resourceName, prefix)

-- always works, by hash
local retval = Citizen.InvokeNative(0x8f2eecc3, resourceName, prefix, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = StartFindExternalKvp(resourceName, prefix);

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

Examples

LUA · Cfx.re native reference
local kvpHandle = StartFindExternalKvp('drugs', 'mollis:')

if kvpHandle ~= -1 then 
	local key
	
	repeat
		key = FindKvp(kvpHandle)

		if key then
			print(('%s: %s'):format(key, GetResourceKvpString(key)))
		end
	until not key

	EndFindKvp(kvpHandle)
else
	print('No KVPs found')
end

Sources

Cfx.re native reference

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