Log In
Sign Up
Hand-checked

INVENTORY::INVENTORY_GET_INVENTORY_ITEM

0x3B546F7668FF1710 ·RVA 0x03E8A4B0

Signature

BOOL INVENTORY_GET_INVENTORY_ITEM(
    int inventoryId,
    Guid* guid,
    InventoryItem* outItem,
    Any p3
);

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*guid –
2InventoryItem*outItem –
3Anyp3 RDR3's fourth argument. The scripts still pass it, but the game doesn't read it.

Returns

BOOL

Notes

  • Fills outItem with the item whose GUID is guid. Returns true if it exists. 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
auto result = invoke<BOOL>(0x3B546F7668FF1710, inventoryId, &guid, &outItem, p3);

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.