Files
overextended.github.io/pages/ox_inventory/Functions/Server/Inventory/RegisterStash.mdx
T
2023-06-04 15:15:21 +02:00

34 lines
1016 B
Plaintext

import { Callout } from 'nextra/components';
Creates a new custom stash.
```lua
exports.ox_inventory:RegisterStash(id, label, slots, maxWeight, owner, groups, coords)
```
- id: `string` or `number`
- Stash identifier when loading from the database.
- label: `string`
- Display name when inventory is open.
- slots: `number`
- maxWeight: `number`
- owner: `string` or `boolean` or `nil`
- `string`: Can only access the stash linked to the owner.
- `true`: Each player has a unique stash but can request other player's stashes.
- `nil`: Always shared.
- groups: `table`
- Table of player groups (jobs) able to access the stash.
- Table of group names where the numeric value is the minimum grade required.
- `{['police'] = 0, ['ambulance'] = 2}`
- coords?: `vector3` or `vector3[]`
<Callout>
This function needs to be triggered before a player can open the stash.
</Callout>
**Example:**
For a use case example on this function check out the written [Guide](../../../Guides/stashes.md) for it.