ATY Scripts Logo
ATY Scripts/Doku/Inventory/Stashes & Shops

Stashes & Shops

Stashes & Shops

Stashes

A stash is a fixed container in the world with its own capacity and, optionally, a job gate.

-- ox's argument order: id, label, slots, maxWeight, owner, groups, coords
exports.aty_inventory:RegisterStash('gang_safe', 'Gang Safe', 50, 100000,
    nil, { 'ballas' }, vec3(441.7, -998.1, 30.7))

groups is a list of job or gang names; a truthy owner gives every character their own copy behind the same id. In config.lua the same stash is a Config.Stashes entry with id, label, slots, maxWeight, owned, groups and coords.

Registered stashes get a marker automatically, and a target zone when Config.Target.enabled is on (off by default, as in ox). Register from any resource, at any time — the world point refreshes without a restart.

Manage them live from the admin panel's Stashes tab. From the console, invplace lists every shop and stash and invplace del stash <id> removes one made from the panel.

A stash written in config and a stash made from the panel are the same thing to everything that reads them — both go through `Stash.Register`. The difference is where they come back from after a restart (the file, or `aty_places`) and which of them the panel may delete: it will not delete one the file declares, because the file would just put it back.

Shops

A shop is a container that sells rather than stores.

Config.Shops = {
    {
        id        = 'store247',
        label     = '24/7 Market',
        currency  = 'cash',
        blip      = { sprite = 59, color = 69, scale = 0.8 },
        locations = {
            vector3(25.7, -1347.3, 29.49),
            vector3(-3038.71, 585.9, 7.9),
        },
        items = {
            { name = 'water', price = 12 },              -- no stock: unlimited
            { name = 'phone', price = 750, stock = 10 },
        },
    },
}

Config.Shops is a list. One definition feeds every branch in locations.

Per-line stock, per branch. Each line has its own count at each location, as in ox_inventory — buy the last phone at one 24/7 and that tile empties there while the other branches and the rest of the shop carry on. Stock comes back on restart. Config.Shops_Restock.every (0 by default, as ox has no restock) refills a share of the gap on a timer instead.

Line metadata. A line's metadata is copied onto the item bought, as ox's shops do.

Job shops. A shop with groups shows its point and blip only to those jobs, and the till refuses anyone else. The shipped Medicine Cabinet is ambulance-only and the Police Armoury police and sheriff, as ox ships them.

Licence gates. A line can require a licence; without it the tile is visible but refuses. See Licences.

A cart, not one-at-a-time. Items go into a basket and check out together, as one transaction.

The cart belongs to the shop it was filled in. Opening a different shop empties it; reopening the same one keeps it and re-reads every line against the shelf's current prices and stock rather than silently carrying the old ones over.

Dynamic pricing

Config.Pricing = { enabled = true }

When on, prices move with what the ledger has actually measured — items that flood the server get cheaper, scarce ones get dearer. It is off by default because it changes the economy's feel, not just its numbers.

invpricing [item]   show the current computed prices
invpricingrun       recompute now

Commands

invplace                          list every shop and stash
invplace del <shop|stash> <id>    remove one made from the panel
invstashreg / invshopreg          self-tests of stash and shop registration
invrestock                        self-test of the restock refill, on a test shop
invclerks / invclerktest          shop clerk peds
ATY Scripts LogoATY SCRIPTS

Hochoptimierte FiveM Scripts für QBCore & ESX. Maximale Performance, präziser Code, kein Lag.

Community beitreten

Partner

Offizieller Tebex-Partner. Sicherer Checkout und Cfx.re-Keymaster-Integration.

Rechtliches

Nicht verbunden mit Rockstar Games, Cfx.re, FiveM oder Take-Two Interactive. Käufe unterliegen den Tebex-Nutzungsbedingungen.

© 2026 ATY SCRIPTS. Alle Rechte vorbehalten.