mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 22:21:48 +00:00
62 lines
1.2 KiB
Plaintext
62 lines
1.2 KiB
Plaintext
import { Tabs, Tab } from 'nextra-theme-docs';
|
|
|
|
Opens an inventory using the passed data.
|
|
|
|
```lua
|
|
exports.ox_inventory:openInventory(invType, data)
|
|
```
|
|
|
|
* invType: `string`
|
|
* `'player'`
|
|
* `'shop'`
|
|
* `'stash'`
|
|
* `'crafting'`
|
|
* `'container'`
|
|
* `'drop'`
|
|
* `'glovebox'`
|
|
* `'trunk'`
|
|
* `'dumpster'`
|
|
* data: `number` or `string` or `table`
|
|
|
|
<Tabs items={['Player', 'Shop', 'Stash']}>
|
|
<Tab>
|
|
|
|
**Open the target player's inventory.**
|
|
|
|
```lua
|
|
exports.ox_inventory:openInventory('player', 3)
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
**Open the fourth "General Store" [location](https://github.com/overextended/ox_inventory/blob/main/data/shops.lua#L14).**
|
|
|
|
```lua
|
|
exports.ox_inventory:openInventory('shop', { type = 'General', id = 4 })
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
**Open the first stash in [data/stashes](https://github.com/overextended/ox_inventory/blob/main/data/stashes.lua#L2-L19).**
|
|
|
|
```lua
|
|
exports.ox_inventory:openInventory('stash', 1)
|
|
```
|
|
|
|
**Open a custom stash (created on the server with RegisterStash).**
|
|
|
|
```lua
|
|
exports.ox_inventory:openInventory('stash', 'society_police')
|
|
```
|
|
|
|
**Open a stash with a specific owner.**
|
|
|
|
```lua
|
|
exports.ox_inventory:openInventory('stash', { id = 'police_locker', owner = 'license:xxxxxxxx' })
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|