RedM Natives

_INVENTORY_GET_INVENTORY_ITEM_COMPATIBLE_SLOTS

Writes up to maxResults compatible SLOTID_* hashes for item into outSlotIds (int32 array; unused entries are 0).

Hash0x9AC53CB6907B4428
Runtime nameInventoryGetInventoryItemCompatibleSlots
NamespaceINVENTORY
SideClient
NameCommunity guess
Docs
Since build1207

Signature

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

Parameters

NameTypeDescription
itemHash—
outSlotIdsint*—
maxResultsint—

Returns BOOL

Description

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).

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
local retval, outSlotIds = InventoryGetInventoryItemCompatibleSlots(item, maxResults)

-- always works, by hash
local retval, outSlotIds = Citizen.InvokeNative(0x9AC53CB6907B4428, item, Citizen.PointerValueInt(), maxResults, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, outSlotIds] = InventoryGetInventoryItemCompatibleSlots(item, maxResults);

// by hash
const [retval, outSlotIds] = Citizen.invokeNative('0x9AC53CB6907B4428', item, Citizen.pointerValueInt(), maxResults, Citizen.returnResultAnyway());
C#
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

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.