# ITEMDATABASE::_ITEMDATABASE_CREATE_ITEM_COLLECTION

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

## Signature

```c
int _ITEMDATABASE_CREATE_ITEM_COLLECTION(Any* data, int* size, int comparisonType);
```

## Parameters

- `data` (`Any*`)
- `size` (`int*`)
- `comparisonType` (`int`)

## Returns

`int`

## Description

Returns collectionId to be used with 0x8750F69A720C2E41 (p0) and 0xCBB7B6EDFA933ADE (p0)
struct ItemCollectionFilter
{
	alignas(8) Hash slotId;
	alignas(8) Hash slotId2;
	alignas(8) Hash tag;
	alignas(8) Hash ciCategory;
	alignas(8) Hash cost;
	alignas(8) Hash unk5;
	alignas(8) int  flags;
	alignas(8) Hash itemType;
	alignas(8) Hash ciTag;
};

## Usage

### Lua

```lua
local retval, data, size = ItemdatabaseCreateItemCollection(comparisonType)

-- always available, by hash
local retval, data, size = Citizen.InvokeNative(0x71EFA7999AE79408, Citizen.PointerValueInt(), Citizen.PointerValueInt(), comparisonType, Citizen.ResultAsInteger())
```

### JavaScript

```js
const [retval, data, size] = ItemdatabaseCreateItemCollection(comparisonType);

// by hash
const [retval, data, size] = Citizen.invokeNative('0x71EFA7999AE79408', Citizen.pointerValueInt(), Citizen.pointerValueInt(), comparisonType, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
var data = new OutputArgument();
var size = new OutputArgument();
int retval = Function.Call<int>((Hash)0x71EFA7999AE79408, data, size, comparisonType);
// data.GetResult<int>()
// size.GetResult<int>()
```

- Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
- `Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below.
- 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.*
