Log In
Sign Up
Hand-checkedUnofficial name

INVENTORY::_INVENTORY_GET_INVENTORY_ITEM_CHILD

0xD4C7C4BB3265B7A0 ·RVA 0x03E8A3F0

Signature

BOOL _INVENTORY_GET_INVENTORY_ITEM_CHILD(
    int inventoryId,
    Guid* parentGuid,
    int childIndex,
    InventoryItem* outItem
);

Parameters 4

#TypeNameNotes
0intinventoryId from _INVENTORY_GET_INVENTORY_ID_FROM_PED(ped); -1 means the ped has no inventory. No script passes a constant.
1Guid*parentGuid –
2intchildIndex –
3InventoryItem*outItem –

Returns

BOOL

Notes

  • Fills outItem with child number childIndex of parentGuid, in any slot. Returns true if there is one. childIndex runs from 0 to the parent's childCount - 1. Read from the game code.
  • Guid: an item's GUID, 16 bytes (two script cells), passed by address. 0x3A4F8A203A40DC55(inventoryId, &guid) gives an inventory's top-level GUID; an empty GUID (kept in the global 0x48391B87 + 0x98) means no item.
  • InventoryItem: 64 bytes (8 script cells); clear it before the call. +0x00 Guid guid (16 bytes); +0x10 Hash item; +0x14 Guid parentGuid (16 bytes); +0x24 Hash slotId; +0x28 BOOL isEquipped (1 byte); +0x30 int64 quantity; +0x38 int childCount (items under this one); +0x3C BOOL isExpired (1 byte: the item has an expiry time and it has passed).
  • The same InventoryItem layout is filled by INVENTORY_GET_INVENTORY_ITEM, _INVENTORY_GET_INVENTORY_ITEM_CHILD, _INVENTORY_GET_INVENTORY_ITEM_EQUIPPED_IN_SLOT and _INVENTORY_GET_ITEM_FROM_COLLECTION_INDEX.

Call it

// INVENTORY::_INVENTORY_GET_INVENTORY_ITEM_CHILD
auto result = invoke<BOOL>(0xD4C7C4BB3265B7A0, inventoryId, &parentGuid, childIndex, &outItem);

Generic call-by-hash templates in the style of the common GTA V / RDR2 script frameworks. Adapt the types to your tooling.

Improve this page

Know what this native does, a better name, or the real parameter types? Suggest an edit. A moderator reviews every suggestion, and approved edits credit you here.