Overview
Storage gives players a place of their own to keep things. They buy a storage where they stand, open it with G, and decide who else gets a key. Servers also get job storages (an evidence locker, a doctor's cabinet), armories with endless stock, and a staff panel to look after all of it.
/createstoragebuys a storage where you stand.- Keys at three levels (Manager, Member, Basic), or let a whole job in by grade.
- Cash kept in every storage, with a ledger of who put in and took out what.
- Upgrades for more space, each one a little dearer than the last.
- Job storages: one stash at several places, or a separate stash at each place (hotel rooms).
- Armories: job-locked shops with endless stock.
- Clerks: NPCs standing at desks.
- A staff panel (
/storageadmin) to find, open, move, rename, resize, give, empty and delete storages. - Moves your players' storages over from Poggy Storage, with everything inside.
Storage is free. You can use it and change it on your own servers; please don't sell it or re-upload it (see LICENSE.md).
Requirements
- poggy_core (free), version 0.25.0 or newer.
- oxmysql.
- One of VORP, RSG Core or QBCore RedM (poggy_core connects the script to it). The storages use your framework's own inventory window.
- No other player-storage script on the same spots at the same time. If you run Poggy Storage (
poggy_character_storage), this replaces it: never run both.
Install
- Download
Britannia_Storagefree from playbritannia.co. - Put the
Britannia_Storagefolder in your server'sresourcesfolder. - Add
ensure Britannia_Storagetoserver.cfg, afterensure oxmysqlandensure poggy_core. - Give your staff the ace:
add_ace group.admin britannia_storage.admin allow(or list their groups inConfig.AdminGroups). - Set prices, sizes, your job storages and armories in
shared/config.lua(see Configuration). - Restart the server.
The tables britannia_storage and britannia_storage_ledger are created automatically.
Coming from Poggy Storage? Remove ensure poggy_character_storage. On the first start, every player storage in its character_storage table is copied across: owner, place, size, keys, job access, money and ledger. Each one keeps its container, so everything inside is still there. For your job storages, set Config.JobContainerPrefix = 'character_storage_' and give each one the same id it had in Poggy's config (use shared = false for one that had a separate stash at each place); their contents carry over too. The old table is left untouched as a rollback.
Configuration
Settings are in shared/config.lua, and every option is commented. Text is in locales/en.lua.
| Setting | What it does | Default |
|---|---|---|
Config.Locale | Language file to use from locales/ | 'en' |
Config.Debug | Prints extra lines in the server and F8 consoles | false |
Config.Commands | The command names: Create, Admin, Move, Delete | createstorage, storageadmin, movestorage, deletestorage |
Config.Key | The key that opens a storage, job storage or armory | 'G' |
Config.OpenDistance | How close (metres) a player must stand | 2.0 |
Config.Storage.Price | What a new storage costs, in cash (0 = free) | 500 |
Config.Storage.StartSlots | How much a new storage holds | 200 |
Config.Storage.MaxPerCharacter | How many storages one character can own (0 = no limit) | 3 |
Config.Storage.MinDistance | The closest (metres) a new storage can be to another | 3.0 |
Config.Storage.MaxNameLength | The longest name a player can give a storage | 30 |
Config.Upgrades | Enabled, Slots added per upgrade, FirstPrice, Increase (0.1 = 10% dearer each time), Max (0 = no limit) | on, 50, 1.5, 0.1, 0 |
Config.Money | Enabled, MaxBalance one storage can hold, LedgerShown (how many entries the ledger shows) | on, 100000, 25 |
Config.JobLevels | The job grades that give Manager and Member access when a job is let in | Manager 2+, Member 1 |
Config.Expiry | Enabled and Days: delete player storages nobody has opened for that long, when the script starts | off, 60 |
Config.Blips | Enabled (a blip for every storage the player can open) and Sprite | off, chest |
Config.AdminAces | Aces that count as staff | britannia_storage.admin |
Config.AdminGroups | Groups that count as staff | admin, superadmin, god |
Config.ImportPoggyStorage | Copy player storages from Poggy Storage on the first start | true |
Config.JobContainerPrefix | The start of every job storage's container id | 'britannia_storage_job_' |
Config.JobStorages | Your job storages (see below) | two examples |
Config.Armories | Your armories (see below) | one example |
Config.Clerks | NPCs at desks: model, coords (vector4), scenario | none |
server/sv_config.lua holds the Discord webhook (SvConfig.Webhook). It logs job storages and armories that have log = true, and every staff change.
Job storages
{
id = 'sheriff_evidence', -- never change it later: the items are stored under it
label = 'Sheriff Evidence',
slots = 2000,
jobs = { sheriff = 0 }, -- job name (exact spelling) = lowest grade
charIds = { '12' }, -- optional: extra characters who may open it
public = false, -- true = anyone can open it
shared = true, -- false = a separate stash at each location
locations = { vector3(-278.69, 806.22, 119.38) },
blip = false, -- or a blip sprite hash
log = false, -- true = post who opened it to Discord
}With shared = false, a location can carry its own name: { coords = vector3(...), label = 'Room 1' }.
Armories
{
id = 'valentine_armory',
label = 'Valentine Armory',
coords = vector3(-276.2, 804.0, 119.38),
jobs = { sheriff = 0 }, -- leave out to open it to everyone
currency = 'cash', -- or 'gold'
items = {
{ item = 'WEAPON_REVOLVER_CATTLEMAN', label = 'Cattleman Revolver', price = 0, weapon = true },
{ item = 'ammorevolvernormal', label = 'Revolver Ammo', price = 2 },
},
blip = false,
log = false,
}Commands and permissions
| Command | Who | What it does |
|---|---|---|
/createstorage | Everyone | Buy a storage where you stand |
/storageadmin | Staff | Opens the staff panel |
/movestorage <id> | Staff | Moves a player storage to where you stand |
/deletestorage <id> | Staff | Deletes a player storage (type its id again to confirm) |
Staff are anyone with an ace in Config.AdminAces, anyone in Config.AdminGroups, and poggy_core admins. For example: add_ace group.admin britannia_storage.admin allow.
How it works
Buying. /createstorage asks you to confirm the price, then a name, and the storage appears where you stand. You can't place one too close to another storage, or own more than Config.Storage.MaxPerCharacter.
Opening. Stand at a storage and press G. Someone with a Basic key goes straight into the storage. Owners, Managers and Members get a menu first:
| Owner | Manager | Member | Basic | |
|---|---|---|---|---|
| Open the storage | ✓ | ✓ | ✓ | ✓ |
| Deposit money, read the ledger | ✓ | ✓ | ✓ | |
| Withdraw money, buy upgrades | ✓ | ✓ | ||
| Rename, keys, job access | ✓ |
Keys. The owner gives a key to someone online (picked from a list) or by character id, as Manager, Member or Basic. The level can be changed or the key taken back, and the holder is told.
Job access. The owner can let a whole job in from a chosen grade. The player's grade then sets their level (Config.JobLevels).
Money. Cash goes in and out of the storage's balance, and the ledger shows who did what, with the balance after each move.
Upgrades. Each upgrade adds Config.Upgrades.Slots slots. The price is FirstPrice × (1 + Increase) ^ upgrades already bought, so each one costs a little more than the last.
Job storages and armories have no menu: the right job opens the stash, or the armory's list of items. In an armory, pick an item and say how many (weapons are one at a time). The job is checked again on every take, and the money comes back if the item doesn't fit in your pockets.
The staff panel. Find any player storage by id, name, owner's name or character id, then open it, go there, move it to where you stand, rename it, change its size, give it to another character, manage its keys, see what's inside, or delete it. Job storages can be opened, visited and checked too. Show every storage on the map puts a blip on each one, just for you.
Troubleshooting
No G prompt at a storage
Stand closer (Config.OpenDistance). You only see prompts for storages you can open: check your key, or the job and grade a job storage needs. Job names are case-sensitive.
Storages from Poggy Storage are missing
The copy only runs while this script's table is empty and Config.ImportPoggyStorage = true. Check the server console for "Copied N storage(s) from Poggy Storage".
A job storage from Poggy Storage is empty
Its container id doesn't match. Set Config.JobContainerPrefix = 'character_storage_' and use the same id as before. A stash that had one inventory per place needs shared = false.
Two prompts at every storage
Poggy Storage is still running. Remove ensure poggy_character_storage and restart.
"You don't have permission to do that."
Give the player the ace britannia_storage.admin, or add their group to Config.AdminGroups.
A deleted storage's items
Deleting forgets the storage but doesn't empty it: the items stay in the inventory database where nobody can reach them. Open it from the staff panel and empty it first if they should go.
Version history
- 1.0.0: first public release.
Still stuck?
Open a ticket on our Discord with your framework, your poggy_core version and what you see, and we'll help you get it running.
Get help on Discord