mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
update custom stashes guide to match new properties style
This commit is contained in:
1 parent
e641798c36
commit
5d2f3e22ff
1 file changed
+22
-30
@@ -5,39 +5,31 @@ title: Creating custom stashes
|
||||
import IconButton from '@site/src/components/IconButton'
|
||||
import { BsGithub } from 'react-icons/bs'
|
||||
|
||||
We can set up custom stashes from outside the resource utilising the exported RegisterStash function. Firstly, we need to define the stashes properties.
|
||||
We can set up custom stashes from outside the resource utilising the exported RegisterStash function.
|
||||
|
||||
```lua
|
||||
-- id: string
|
||||
-- label: string
|
||||
-- slots: number
|
||||
-- weight: number
|
||||
-- owner: string or boolean (optional)
|
||||
-- groups: table (optional)
|
||||
-- name: string
|
||||
-- grade: number
|
||||
-- coords: vector or table (optional)
|
||||
```
|
||||
Firstly, we need to define the stashes properties.
|
||||
|
||||
- `id` - A unique name to identify the stash in the database
|
||||
- `label` - Display name when viewing the stash
|
||||
- `slots` - Number of slots that the stash will have
|
||||
- `weight` - Maximum stash weight
|
||||
- `owner` - See below
|
||||
- `groups` - Key-value pairs of job name and minimum grade to access
|
||||
- `coords` - Vector or table containing coordinates
|
||||
### Stash properties
|
||||
|
||||
The owner field will set permissions for stash access, with stashes registering to specific identifiers.
|
||||
- true: Each player has their own unique stash, but can request to open the stash of another player
|
||||
- false: Only a single stash exists and is shared between all players
|
||||
- string: The stash explicitly belongs to the given owner, usually a player identifier
|
||||
|
||||
The groups field will restrict access to the given jobs / grades such as below
|
||||
```
|
||||
groups = {["police"] = 0, ["ambulance"] = 2}
|
||||
```
|
||||
|
||||
You can set the stash coordinates to prevent the stash from being opened if the player isn't close enough.
|
||||
* id: `string`
|
||||
* Unique name to identify the stash in the database.
|
||||
* label: `string`
|
||||
* Display name when viewing the stash.
|
||||
* slots: `number`
|
||||
* Number of slots the stash will have.
|
||||
* weight: `number`
|
||||
* Maximum weight of the stash inventory.
|
||||
* owner?: `string` or `boolean`
|
||||
* `true`: Each player has their own unique stash, but can request to open the stash of another player
|
||||
* `false`: Only a single stash exists and is shared between all players
|
||||
* `string`: The stash explicitly belongs to the given owner, usually a player identifier
|
||||
* groups?: `table`
|
||||
* Key-value pairs of job name and minimum grade to be able to access the stash. (`{["police"] = 0, ["ambulance"] = 2}`)
|
||||
* name: `string`
|
||||
* grade: `number`
|
||||
* coords?: `vector3` or `table`
|
||||
* You can set the stash coordinates to prevent the stash from being opened if the player isn't close enough.
|
||||
* Vector or table containing the coordinates of the stash.
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
Reference in new issue
Block a user