Shops and Stashes
Static shops​
Define built-in shops in data/shops.lua.
General = {
name = 'General Store',
blip = { id = 59, colour = 69, scale = 0.7 },
inventory = {
{ name = 'water', price = 5 },
{ name = 'sandwich', price = 10 },
},
locations = {
{ x = 25.7, y = -1347.3, z = 29.5 },
},
}
Shop fields​
| Field | Purpose |
|---|---|
name / label | Display name. |
inventory | Items sold by the shop. |
locations | World locations for proximity access. |
targets | Target-shaped locations accepted by the registry. |
groups / jobs | Framework groups allowed to use the shop. |
blip | Map blip configuration. |
Each inventory listing accepts name, price, count, stock, currency, metadata, license, and grade.
countis the number of items granted per purchase unit.stockis the number of purchase units available until resource restart; omit it for unlimited stock.currencydefaults tomoney.
Register a scripted shop​
exports.wasabi_inventory:RegisterShop('PoliceArmory', {
name = 'Police Armory',
groups = { police = 0 },
inventory = {
{ name = 'WEAPON_PISTOL', price = 500, grade = 1 },
{ name = 'ammo-9', price = 25 },
},
})
A shop without locations can be opened from a trusted script with the client openInventory export.
Register a persistent stash​
exports.wasabi_inventory:RegisterStash(
'police_evidence',
'Evidence Locker',
80,
250000,
false,
{ police = 0 },
vector3(474.6, -996.7, 26.3)
)
owner controls separation:
nilorfalse→ one shared stash.true→ a personal stash for each player's framework identifier.- A string → a fixed owner namespace.
groups and coords are enforced when the stash is opened normally.
Open a stash​
Register the stash on the server before opening it on the client:
exports.wasabi_inventory:RegisterStash('personal_locker', 'Locker', 40, 100000, true)
exports.wasabi_inventory:openInventory('stash', {
id = 'personal_locker',
})
Temporary stashes​
Temporary stashes live in memory and are not persisted.
local stashId = exports.wasabi_inventory:CreateTemporaryStash({
label = 'Mission Supplies',
slots = 10,
maxWeight = 25000,
items = {
{ name = 'water', count = 2 },
},
})
Remove a temporary or loaded secondary inventory with RemoveInventory when it is no longer needed.