RedM Natives

DATADICT_GET_TYPE

Hash0x92E11E3CA4C7CDF0
Runtime nameDatadictGetType
NamespaceDATAFILE
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x031C55ED33227371

Signature

int DATADICT_GET_TYPE(Any* objectData, const char* key);

Parameters

NameTypeDescription
objectDataAny*—
keyconst char*—

Returns int

Description

Types:
1 = Boolean
2 = Integer
3 = Float
4 = String
5 = Vector3
6 = Object
7 = Array

Usage

Lua
local retval, objectData = DatadictGetType(key)

-- always works, by hash
local retval, objectData = Citizen.InvokeNative(0x92E11E3CA4C7CDF0, Citizen.PointerValueInt(), key, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const [retval, objectData] = DatadictGetType(key);

// by hash
const [retval, objectData] = Citizen.invokeNative('0x92E11E3CA4C7CDF0', Citizen.pointerValueInt(), key, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
var objectData = new OutputArgument();
int retval = Function.Call<int>((Hash)0x92E11E3CA4C7CDF0, objectData, key);
// objectData.GetResult<int>()
  • Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
  • Any* arguments are often structs. Build them with a DataView buffer and pass it with :Buffer() — see the examples and notes below.

See also

Sources

alloc8or RDR3 NativeDB

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