Hand-checkedUnofficial name
INVENTORY::_INVENTORY_GET_INVENTORY_ITEM_EQUIPPED_IN_SLOT
0x4DA0A53541FEDA8E ·RVA 0x03E8A130
Signature
BOOL _INVENTORY_GET_INVENTORY_ITEM_EQUIPPED_IN_SLOT(
int inventoryId,
Guid* parentGuid,
Hash slotId,
int index,
InventoryItem* outItem
);
Parameters 5
| # | 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* | parentGuid |
– |
| 2 | Hash | slotId |
a SLOTID_ hash (joaat of the name, as in RDR3), e.g. SLOTID_WARDROBE_ARMOR_TORSO (0x9FD13851), SLOTID_OWNED_WEAPONS_0 (0x7A78C04D), SLOTID_TRUNK_SLOT_0 to _9. |
| 3 | int | index |
0 up to INVENTORY_GET_CHILDREN_IN_SLOT_COUNT(inventoryId, parentGuid, slotId) - 1; the scripts loop over it. |
| 4 | InventoryItem* | outItem |
– |
Returns
BOOL
Notes
- Fills outItem with the item at position index among the items in slot slotId under parentGuid. Returns true if there is one. Read from the game code (the native at 0x03E8A130) and the six calls in the scripts.
- 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_EQUIPPED_IN_SLOT
auto result = invoke<BOOL>(0x4DA0A53541FEDA8E, inventoryId, &parentGuid, slotId, index, &outItem);// INVENTORY::_INVENTORY_GET_INVENTORY_ITEM_EQUIPPED_IN_SLOT
bool result = Function.Call<bool>((Hash)0x4DA0A53541FEDA8E, inventoryId, parentGuid, slotId, index, outItem);-- INVENTORY::_INVENTORY_GET_INVENTORY_ITEM_EQUIPPED_IN_SLOT
local result = Citizen.InvokeNative(0x4DA0A53541FEDA8E, inventoryId, parentGuid, slotId, index, outItem)// INVENTORY::_INVENTORY_GET_INVENTORY_ITEM_EQUIPPED_IN_SLOT
const result = Citizen.invokeNative("0x4DA0A53541FEDA8E", inventoryId, parentGuid, slotId, index, 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.