{"hash":"0x9AC53CB6907B4428","ns":"INVENTORY","name":"_INVENTORY_GET_INVENTORY_ITEM_COMPATIBLE_SLOTS","slug":"_INVENTORY_GET_INVENTORY_ITEM_COMPATIBLE_SLOTS","official":false,"named":true,"luaName":"InventoryGetInventoryItemCompatibleSlots","game":"rdr3","apiset":"client","returnType":"BOOL","params":[{"name":"item","type":"Hash"},{"name":"outSlotIds","type":"int*"},{"name":"maxResults","type":"int"}],"summary":"Writes up to maxResults compatible SLOTID_* hashes for item into outSlotIds (int32 array; unused entries are 0).","descriptions":[{"source":"alloc8or","format":"text","body":"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.\nExample (C++):\n\tHash item = joaat(\"horse_equipment_western_04_stock_new_saddle_005\");\n\tint out[30] = {};\n\tif (INVENTORY::_INVENTORY_GET_INVENTORY_ITEM_COMPATIBLE_SLOTS(item, out, 30)) {\n\t\tfor (int i = 0; i < 30 && out[i] != 0; ++i) {\n\t\t\tprintf(\"slot[%d] = 0x%08X\\n\", i + 1, (unsigned)out[i]);\n\t\t}\n\t}\nTypical 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":"vorp","format":"text","body":"p1 (out) and p2 (in) are both script arrays?\nitem: can be a component item, see SHOP_CATALOG_BUILD_LIST_OF_WEAPON_COMPONENTS"}],"examples":[],"aliases":[],"enums":[],"related":[],"build":"1207","sources":["alloc8or","vorp"],"doc":2,"url":"https://natives.borderlinerp.com/natives/INVENTORY/_INVENTORY_GET_INVENTORY_ITEM_COMPATIBLE_SLOTS","markdownUrl":"https://natives.borderlinerp.com/natives/INVENTORY/_INVENTORY_GET_INVENTORY_ITEM_COMPATIBLE_SLOTS.md","snippets":{"lua":"local retval, outSlotIds = InventoryGetInventoryItemCompatibleSlots(item, maxResults)","luaInvoke":"local retval, outSlotIds = Citizen.InvokeNative(0x9AC53CB6907B4428, item, Citizen.PointerValueInt(), maxResults, Citizen.ReturnResultAnyway())","js":"const [retval, outSlotIds] = InventoryGetInventoryItemCompatibleSlots(item, maxResults);","jsInvoke":"const [retval, outSlotIds] = Citizen.invokeNative('0x9AC53CB6907B4428', item, Citizen.pointerValueInt(), maxResults, Citizen.returnResultAnyway());","csharp":"var outSlotIds = new OutputArgument();\nbool retval = Function.Call<bool>((Hash)0x9AC53CB6907B4428, item, outSlotIds, maxResults);\n// outSlotIds.GetResult<int>()","notes":["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."]}}