# INVENTORY::_INVENTORY_GET_INVENTORY_ITEM_COMPATIBLE_SLOTS

- **Hash:** `0x9AC53CB6907B4428`
- **Namespace:** INVENTORY
- **Runtime name (Lua/JS):** `InventoryGetInventoryItemCompatibleSlots`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/INVENTORY/_INVENTORY_GET_INVENTORY_ITEM_COMPATIBLE_SLOTS

## Signature

```c
BOOL _INVENTORY_GET_INVENTORY_ITEM_COMPATIBLE_SLOTS(Hash item, int* outSlotIds, int maxResults);
```

## Parameters

- `item` (`Hash`)
- `outSlotIds` (`int*`)
- `maxResults` (`int`)

## Returns

`BOOL`

## Description

*Source: alloc8or RDR3 NativeDB*

Writes up to maxResults compatible SLOTID_* hashes for item into outSlotIds (int32 array; unused entries are 0). Commonly used to gather valid equip slots for component/decoration items. Returns true on success.
Example (C++):
	Hash item = joaat("horse_equipment_western_04_stock_new_saddle_005");
	int out[30] = {};
	if (INVENTORY::_INVENTORY_GET_INVENTORY_ITEM_COMPATIBLE_SLOTS(item, out, 30)) {
		for (int i = 0; i < 30 && out[i] != 0; ++i) {
			printf("slot[%d] = 0x%08X\n", i + 1, (unsigned)out[i]);
		}
	}
Typical result for the sample item includes: SLOTID_HORSE_SADDLEBAG, SLOTID_HORSE_BEDROLL, SLOTID_HORSE_HORN, SLOTID_HORSE_STIRRUP, SLOTID_HORSE_BLANKET, SLOTID_HORSE_REINS, SLOTID_HORSE_SEAT, SLOTID_HORSE_FENDER, SLOTID_HORSE_SKIRT, SLOTID_HORSE_CANTLE, SLOTID_HORSE_LANTERN, SLOTID_HORSE_MASK. Note (FiveM DataView): read each int at an 8-byte stride (i*8).

*Source: VORPCORE RDR3natives*

p1 (out) and p2 (in) are both script arrays?
item: can be a component item, see SHOP_CATALOG_BUILD_LIST_OF_WEAPON_COMPONENTS

## Usage

### Lua

```lua
local retval, outSlotIds = InventoryGetInventoryItemCompatibleSlots(item, maxResults)

-- always available, by hash
local retval, outSlotIds = Citizen.InvokeNative(0x9AC53CB6907B4428, item, Citizen.PointerValueInt(), maxResults, Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const [retval, outSlotIds] = InventoryGetInventoryItemCompatibleSlots(item, maxResults);

// by hash
const [retval, outSlotIds] = Citizen.invokeNative('0x9AC53CB6907B4428', item, Citizen.pointerValueInt(), maxResults, Citizen.returnResultAnyway());
```

### C#

```csharp
var outSlotIds = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x9AC53CB6907B4428, item, outSlotIds, maxResults);
// outSlotIds.GetResult<int>()
```

- Hash parameters: the named function also accepts a string and hashes it for you; `Citizen.InvokeNative` needs the number — pass `joaat("name")` or a backtick literal like `` `name` ``.
- Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
- 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, VORPCORE RDR3natives.*
