# INVENTORY::_INVENTORY_CREATE_SORTED_COLLECTION

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

## Signature

```c
int _INVENTORY_CREATE_SORTED_COLLECTION(int inventoryId, int p1, int* size);
```

## Parameters

- `inventoryId` (`int`)
- `p1` (`int`)
- `size` (`int*`)

## Returns

`int`

## Description

p1: 32
Returns collectionId

## Usage

### Lua

```lua
local retval, size = InventoryCreateSortedCollection(inventoryId, p1, size)

-- always available, by hash
local retval, size = Citizen.InvokeNative(0xBB7F968675B34B0C, inventoryId, p1, Citizen.PointerValueIntInitialized(size), Citizen.ResultAsInteger())
```

### JavaScript

```js
const [retval, size] = InventoryCreateSortedCollection(inventoryId, p1, size);

// by hash
const [retval, size] = Citizen.invokeNative('0xBB7F968675B34B0C', inventoryId, p1, Citizen.pointerValueIntInitialized(size), Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
var size = new OutputArgument();
int retval = Function.Call<int>((Hash)0xBB7F968675B34B0C, inventoryId, p1, size);
// size.GetResult<int>()
```

- The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
- 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.*
