Free scripts
Poggy Storage
Player-owned storage for RedM: players buy a stash where they stand, upgrade it and choose who else gets a key. Job storages, job-locked armories and Discord logging are included.
Overview#
Poggy Storage lets players buy a storage at the spot where they stand, keep their gear in it, and decide who else may open it. Storages survive restarts. A storage can be shared with named characters or with a whole job, and each one has its own money balance and ledger.
You can also set up storages that belong to a job (police evidence, a doctor's cabinet), and armories: job-locked shops with endless stock. Admins manage every storage from one table in /poggy.
- Player-owned storages, with paid capacity upgrades that cost a little more each time.
- Keys for named characters at three levels (Manager, Member, Basic), or for a whole job by grade.
- A money balance and a ledger in every storage.
- Map blips for the storages a player can open.
- Job storages, clerk NPCs and job-locked armories, set in the config or in
/poggy. - Optional Discord logging for job storages and armories.
- A Storages panel in
/poggyto rename, resize, move, re-own or delete any storage, manage its keys and see what is inside. - English, Spanish and German text.
Requirements#
| Needs | Why |
|---|---|
| poggy_core 0.14.0 or newer | Characters, money, containers, notifications, menus and text prompts. Free. |
| oxmysql | The database. |
| VORP Core, RSG Core or QBCore RedM | The stashes live in your framework's inventory. |
No menu, input or inventory add-on is needed: every menu, prompt, container and shop is drawn by poggy_core.
Installation#
- Download Poggy Storage and put the
poggy_character_storagefolder in your resources folder. - Add it to
server.cfg, after poggy_core and oxmysql:ensure oxmysql ensure poggy_core ensure poggy_character_storage - Give your admins the permission (see Permissions).
- Start the server and check the console for the ready line from
poggy_character_storage.
There is no SQL to import. The character_storage table is created and kept up to date automatically each time the script starts.
Unused storages are deleted by default. Out of the box, a player storage nobody has opened for 60 days is deleted when the script starts, with no warning. If your players take long breaks, turn off Delete unused storages (see Configuration) before you go live.
Configuration#
Every setting can be changed in game: type /poggy and open Poggy Storage. You can also edit config.lua by hand (the translations are in the same file). Restart the script after a change.
Buying and upgrading
| Setting | Default | What it does |
|---|---|---|
Creation price (Config.StorageCreationPrice) | 5 | Cash a player pays to create a storage. Use whole dollars. 0 makes storages free. |
First upgrade price (Config.StorageUpgradePrice) | 1.5 | Price of the first capacity upgrade. Prices are rounded down to whole dollars, so 1.5 charges $1. |
Upgrade price increase (Config.StorageUpgradePriceMultiplier) | 0.1 | How much each upgrade raises the next. Price = first upgrade price × (1 + this) to the power of upgrades already bought. 0.1 is 10% more each time. |
Slots per upgrade (Config.StorageUpgradeSlots) | 25 | Capacity each upgrade adds. |
Starting capacity (Config.DefaultCapacity) | 200 | Capacity of a new player storage. |
Storages per character (Config.MaxStorages) | 2 | How many storages one character may own. Storages they only have a key to do not count. |
The number of upgrades a storage has is worked out from its capacity. If you change Starting capacity or Slots per upgrade later, the next upgrade price of existing storages changes too.
Player storages
| Setting | Default | What it does |
|---|---|---|
Open distance (Config.AccessRadius) | 2.0 | How close a player must stand to get the open prompt, for player and job storages. |
Delete unused storages (Config.EnableStorageExpiration) | true | When the script starts, player storages nobody has opened for the number of days below are deleted. Job storages are never deleted. |
Unused for (Config.StorageExpirationDays) | 60 | Days without anyone opening a player storage before it is deleted. |
Manager grades (Config.ManagerJobGrades) | {2} | Job grades that get Manager access when a storage lets a whole job in. |
Member grades (Config.MemberJobGrades) | {1} | Job grades that get Member access. Any grade in neither list gets Basic access. |
Map blips (Config.UseBlips) | true | A blip on every storage the player can open. Off removes all storage blips, for admins too. |
Player storage blip (Config.BlipSprite) | chest icon | Blip icon hash for player storages. Job storages use their own. |
Open key (Config.PromptKey) | G | The key that opens a storage. |
Language (Config.DefaultLanguage) | "english" | english, spanish or german. Every line can be reworded on the Text & language tab. |
Job storages
Job storages (Config.DefaultStorages, the Locations tab) are stashes you define: nobody buys them and they never expire. The shipped examples are a police evidence storage at eight sheriff offices and a doctor storage at seven doctor's offices. Each one has:
| Field | What it does |
|---|---|
id | Unique id. The items are stored under it, so never change it once players use the storage. |
name | Shown on the prompt and the blip. |
locations | Every spot it can be opened from. |
linked | true: every location opens the same inventory. false gives each location its own stash; see the commented example at the end of Config.DefaultStorages. |
capacity | How many slots it holds. |
authorized_jobs | Which jobs may open it: ["sheriff"] = { all_grades = true }, or { grades = { 2 } } for grade 2 and above. Job names are case-sensitive. |
authorized_charids | Extra characters, by character id, who may open it (Basic access). |
public_access | Optional. true lets anyone open it with Basic access. |
discord | Optional Discord tracking (see below). |
Clerks (Config.NPCs) are decorative NPCs, such as a clerk behind the evidence desk. They are frozen, cannot be hurt and are not interactive. They spawn within 80 m and despawn past 100 m by default.
Armories
An armory (Config.ArmoryShops, the Armories tab) is a job-locked shop with endless stock. One ships as an example, at Blackwater for police, sheriff and marshal.
| Setting | Default | What it does |
|---|---|---|
Armory open distance (Config.ArmoryAccessRadius) | 2.0 | How close a player must stand to an armory. |
Armory key (Config.ArmoryPromptKey) | G | The key that opens an armory. |
Default quantity (Config.ArmoryDefaultQuantity) | 1 | The number already filled in the "How many?" box. Weapons are always one. |
Currency (Config.ArmoryCurrencyType) | 0 (cash) | What armory prices are charged in: 0 cash, 1 gold. |
Each armory has a position, an id, a name, a job list (joblock, empty for everyone), an optional clerk and blip, and sellitems: the name of an item list in the config, such as "WeaponArmoryItems". That shipped list holds the stock weapons, ammunition, gun oil and handcuffs, all at price 0.0 (shown as Free). Each item has a name, a label, a price and a type (item_weapon or item_standard).
Discord logging
Every job storage and armory has a discord block, off by default. A job storage posts an inventory summary (every 600 seconds by default) and an activity log of who took or added what; an armory posts who took what.
- Paste a channel webhook into
webhookand setenabled = true. - Restart the script. The server console prints the message ids it created.
- Paste them into
inventory_message_idandactivity_message_id, so the same messages are edited from then on instead of new ones being posted.
Commands#
Command names can be changed on the Access & permissions tab. The defaults:
| Command | Who | What it does |
|---|---|---|
/createstorage | Everyone | Opens the create menu. Confirming buys a storage where you stand, for the creation price. |
/movestorage <id> <x> <y> <z> | Admins | Moves a player storage. Job storages are moved by editing their locations. |
/deletestorage <id> | Admins | Deletes a player storage. Its contents are not emptied: they stay in the inventory database, out of reach. |
/storageadmin show | Admins | Shows the blip of every storage on the server. |
/storageadmin hide | Admins | Back to only the storages you can open. |
/adminshop [search] | Admins | A free shop for every item on the server. It asks what you are looking for and lists up to 50 matches; put the search after the command to skip the question. |
/adminshop cache | Admins | Rebuilds that shop's item list after you add items. |
| G | Everyone | Opens a storage or armory you are standing at. |
Permissions#
A player is a storage admin if they have the ACE, or their character's group is in Admin groups.
add_ace group.admin character_storage.admin allow
| Setting | Default | What it does |
|---|---|---|
Admin ACE (Config.AdminAce) | character_storage.admin | The ACE checked first. |
Admin groups (Config.AdminGroups) | admin, superadmin, god | Character groups (as poggy_core reports them) that count as admins. Checked after the ACE. Not case-sensitive. |
The Storages panel in /poggy is open to whoever may edit settings in /poggy.
Access levels inside a storage
| Level | Can do |
|---|---|
| Owner | Everything, including rename and managing who has access. |
| Manager | Open, deposit, withdraw, read the ledger, upgrade. |
| Member | Open, deposit, read the ledger. |
| Basic | Open the storage only. |
The owner gives named characters a level. When a storage lets a whole job in, the player's grade decides the level: grades in Manager grades get Manager, grades in Member grades get Member, any other grade gets Basic.
Using it in game#
For players
- Stand where you want the storage and type
/createstorage. Confirm to pay and create it. - Walk up to it and press G. The menu lets you open it, rename it, upgrade it, deposit and withdraw money, and read the ledger, depending on your access level.
- Under Access Management the owner adds players (by searching or by name) and sets their level, or adds a job rule such as
police 0,1,2orpolice all.
Armories
- Walk up to the armory and press G. Your job is checked when it opens and again on every take.
- Pick an item and say how many. Weapons are always one.
- The script checks you can carry it, takes the money, then gives the item. If the inventory refuses it, the money is refunded.
For admins: the Storages panel
Open /poggy → Poggy Storage → Storages. It lists every storage, player and job, with its owner, location, slots, upgrades, keys and jobs. Changes apply at once, with no restart.
- Rename or resize a player storage by editing the cell. Lowering the size below what is inside keeps the items, but nothing more fits.
- Move to my position, Change owner and Delete storage on each row. Change owner and Delete ask you to type the storage id to confirm.
- Open a row to give a character a key, change a level or remove access.
- Contents on any row, job storages too, shows what is inside and lets you add, remove or empty it.
Job storages are read-only in the panel apart from Contents; change them in the config. Every change is printed to the server console with who made it.
Deleting a storage (panel or /deletestorage) does not empty it. If the items should go, open Contents and choose Empty first.
Troubleshooting#
- A storage looks empty after a restart
- Make sure poggy_core starts before poggy_character_storage in
server.cfg. - A player storage disappeared
- It may have expired: nobody opened it for Unused for days while Delete unused storages was on (60 days by default).
- No prompt at a storage
- Stand closer, or raise Open distance.
- No blips at all
- Check Map blips is on.
- An admin command says no permission
- Grant the ACE, or add the character's group to Admin groups.
- A job storage or armory will not open for a job
- Job names are case-sensitive. Use exactly the name your framework uses.
- Discord posts nothing
- Paste a real webhook URL, set
enabled = true, and restart. - Discord posts a new message every restart
- Paste the message ids the console printed into the storage's or armory's
discordblock. - Text shows a key such as
storage_created - That line is missing from your language block. Copy it from
english.
Updating#
Poggy Storage updates through poggy_core's updater, which keeps your values in config.lua (see Updates).
From the old character_storage folder
- Remove the old
character_storagefolder and put inpoggy_character_storage. - In
server.cfg, changeensure character_storagetoensure poggy_character_storage.
Your data carries over: the table is still character_storage, the containers keep their ids, and the admin ACE is still character_storage.admin. If another resource called this one by its old name, point it at poggy_character_storage.