The Lab
INVENTORY native

_INVENTORY_CREATE_ITEM_COLLECTION

returns int4 paramsbuild 1207

Builds a collection of items from inventory inventoryId matching filterName and slotId, writing its size to size. Returns the collection id.

Free it with _INVENTORY_RELEASE_ITEM_COLLECTION when you are done iterating.

Signature

C
int _INVENTORY_CREATE_ITEM_COLLECTION(int inventoryId, const char* filterName, Hash slotId, int* size); // 0x80D78BDC9D88EF07 b1207

Parameters

#NameType
1inventoryIdint
2filterNameconst char*
3slotIdHash
4sizeint* (out pointer)

Facts

Facts about _INVENTORY_CREATE_ITEM_COLLECTION
Name
_INVENTORY_CREATE_ITEM_COLLECTION
Hash
0x80D78BDC9D88EF07
Namespace
Returns
int
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result, size = Citizen.InvokeNative(0x80D78BDC9D88EF07, -- _INVENTORY_CREATE_ITEM_COLLECTION
  0, -- int inventoryId
  "text", -- const char* filterName
  GetHashKey("name"), -- Hash slotId
  Citizen.PointerValueInt(), -- int* size
  Citizen.ResultAsInteger()
)
print(result, size)
JavaScript
const [result, size] = Citizen.invokeNative("0x80D78BDC9D88EF07", // _INVENTORY_CREATE_ITEM_COLLECTION
  0, // int inventoryId
  "text", // const char* filterName
  GetHashKey("name"), // Hash slotId
  Citizen.pointerValueInt(), // int* size
  Citizen.resultAsInteger()
);
console.log(result, size)
C#
var sizeArg = new OutputArgument();
int result = Function.Call<int>((Hash)0x80D78BDC9D88EF07, // _INVENTORY_CREATE_ITEM_COLLECTION
  0, // int inventoryId
  "text", // const char* filterName
  (uint)API.GetHashKey("name"), // Hash slotId
  sizeArg // int* size
);
int size = sizeArg.GetResult<int>();
All INVENTORY natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.