RedM Natives

_INVENTORY_GET_INVENTORY_ITEM_EQUIPPED_IN_SLOT

Hash0xBE012571B25F5ACA
Runtime nameInventoryGetInventoryItemEquippedInSlot
NamespaceINVENTORY
SideClient
NameCommunity guess
Docs
Since build1207

Signature

int _INVENTORY_GET_INVENTORY_ITEM_EQUIPPED_IN_SLOT(int inventoryId, Any* guid, Hash slotId, int p3, Any* p4);

Parameters

NameTypeDescription
inventoryIdint—
guidAny*—
slotIdHash—
p3int—
p4Any*—

Returns int

Usage

Lua
local retval, guid, p4 = InventoryGetInventoryItemEquippedInSlot(inventoryId, slotId, p3)

-- always works, by hash
local retval, guid, p4 = Citizen.InvokeNative(0xBE012571B25F5ACA, inventoryId, Citizen.PointerValueInt(), slotId, p3, Citizen.PointerValueInt(), Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const [retval, guid, p4] = InventoryGetInventoryItemEquippedInSlot(inventoryId, slotId, p3);

// by hash
const [retval, guid, p4] = Citizen.invokeNative('0xBE012571B25F5ACA', inventoryId, Citizen.pointerValueInt(), slotId, p3, Citizen.pointerValueInt(), Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
var guid = new OutputArgument();
var p4 = new OutputArgument();
int retval = Function.Call<int>((Hash)0xBE012571B25F5ACA, inventoryId, guid, slotId, p3, p4);
// guid.GetResult<int>()
// p4.GetResult<int>()
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.
  • 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.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

Sources

alloc8or RDR3 NativeDB

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