RedM Natives

START_FIND_KVP

Hash0xDD379006
Runtime nameStartFindKvp
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

int START_FIND_KVP(char* prefix);

Parameters

NameTypeDescription
prefixchar*

A prefix match

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

Usage

Lua
local retval = StartFindKvp(prefix)

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

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

Examples

LUA · Cfx.re native reference
SetResourceKvp('mollis:2', 'should be taken with alcohol')
SetResourceKvp('mollis:1', 'vesuvius citrate')
SetResourceKvp('mollis:manufacturer', 'Betta Pharmaceuticals')

local kvpHandle = StartFindKvp('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

See also

Sources

Cfx.re native reference

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