mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 22:21:48 +00:00
61 lines
1.3 KiB
Plaintext
61 lines
1.3 KiB
Plaintext
import { Tabs, Tab } from 'nextra-theme-docs';
|
|
|
|
Opens an inventory using the passed data.
|
|
Forces a player to open an inventory, without usual security checks (groups, coords).
|
|
|
|
```lua
|
|
exports.ox_inventory:forceOpenInventory(playerId, invType, data)
|
|
```
|
|
|
|
- playerId: `number`
|
|
- invType: `string`
|
|
- `'player'`
|
|
- `'stash'`
|
|
- `'container'`
|
|
- `'drop'`
|
|
- `'glovebox'`
|
|
- `'trunk'`
|
|
- `'dumpster'`
|
|
- data: `number` or `string` or `table`
|
|
|
|
<Tabs items={["Player", "Stash"]}>
|
|
<Tab>
|
|
|
|
**Open the target player's inventory.**
|
|
|
|
```lua
|
|
exports.ox_inventory:forceOpenInventory(1, 'player', 3)
|
|
```
|
|
|
|
**Admin command to open a player's inventory.**
|
|
|
|
```lua
|
|
RegisterCommand('openplayerinv', function(source, args)
|
|
exports.ox_inventory:forceOpenInventory(source, 'player', tonumber(args[1]))
|
|
end, true)
|
|
```
|
|
|
|
</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:forceOpenInventory(1, 'stash', 'apartment420')
|
|
```
|
|
|
|
**Open a custom stash (created on the server with RegisterStash).**
|
|
|
|
```lua
|
|
exports.ox_inventory:forceOpenInventory(1, 'stash', 'society_police')
|
|
```
|
|
|
|
**Open a stash with a specific owner.**
|
|
|
|
```lua
|
|
exports.ox_inventory:forceOpenInventory(1, 'stash', { id = 'police_locker', owner = 'license:xxxxxxxx' })
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|