RedM Natives

_INVENTORY_GET_INVENTORY_ITEM_CHILD

Hash0xCD9A485F2B383B44
Runtime nameInventoryGetInventoryItemChild
NamespaceINVENTORY
SideClient
NameCommunity guess
Docs
Since build1207

Signature

BOOL _INVENTORY_GET_INVENTORY_ITEM_CHILD(int inventoryId, Any* parentGuid, Any childIndex, Any* outInventoryItem);

Parameters

NameTypeDescription
inventoryIdint—
parentGuidAny*—
childIndexAny—
outInventoryItemAny*—

Returns BOOL

Usage

Lua
local retval, parentGuid, outInventoryItem = InventoryGetInventoryItemChild(inventoryId, childIndex)

-- always works, by hash
local retval, parentGuid, outInventoryItem = Citizen.InvokeNative(0xCD9A485F2B383B44, inventoryId, Citizen.PointerValueInt(), childIndex, Citizen.PointerValueInt(), Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, parentGuid, outInventoryItem] = InventoryGetInventoryItemChild(inventoryId, childIndex);

// by hash
const [retval, parentGuid, outInventoryItem] = Citizen.invokeNative('0xCD9A485F2B383B44', inventoryId, Citizen.pointerValueInt(), childIndex, Citizen.pointerValueInt(), Citizen.returnResultAnyway());
C#
var parentGuid = new OutputArgument();
var outInventoryItem = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0xCD9A485F2B383B44, inventoryId, parentGuid, childIndex, outInventoryItem);
// parentGuid.GetResult<int>()
// outInventoryItem.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.
  • 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.