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
| # | Type | Name | Notes |
|---|---|---|---|
| 0 | int | inventoryId |
from _INVENTORY_GET_INVENTORY_ID_FROM_PED(ped); -1 means the ped has no inventory. No script passes a constant. |
| 1 | Guid* | guid |
– |
| 2 | InventoryItem* | outItem |
– |
| 3 | Any | p3 |
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);// INVENTORY::INVENTORY_GET_INVENTORY_ITEM
bool result = Function.Call<bool>((Hash)0x3B546F7668FF1710, inventoryId, guid, outItem, p3);-- INVENTORY::INVENTORY_GET_INVENTORY_ITEM
local result = Citizen.InvokeNative(0x3B546F7668FF1710, inventoryId, guid, outItem, p3)// INVENTORY::INVENTORY_GET_INVENTORY_ITEM
const result = Citizen.invokeNative("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.