Overview
Britannia_Markets is a complete market for your server: the stores in town, the shops players own, and an economy that moves.
- Town stores with a clerk behind every counter (each town's own shopkeeper where the game has one), a map blip and a key hint. A store type names the item lists it sells and buys (
shared/catalog.lua); lines can have a stock that sells out and comes back. Stores can sell weapons too. - Our shop window: item cards with pictures, categories, search, a basket, and a Sell tab. Pay with cash or gold (1 gold = $30 by default); gold rounds in the shop's favour, so swapping between the two never pays.
- Player shops: a player uses a shop token where they want their shop, or staff hand them a town store or a storefront. The owner presses G at the counter for:
- Shelf: stock it from their bags, set prices, hide back-stock;
- Buying: what the shop buys from the public, paid from the till (type two letters and every matching item on the server drops down);
- Till: a cash till and a gold till, pay in or take out;
- Dashboard: takings today, this week and this month, a graph per day, best sellers, slow sellers that might need a lower price, low stock, and the sales history;
- Ledger, Staff (hire anyone online as Manager or Employee, each with their own permissions) and Settings (name, map blip, open or closed, hand the shop to another player).
- Job shops: a shop can be run by a job; everyone with that job works there, by grade.
- Tax: rent (and an optional share of sales) comes out of the till every week. When the till can't pay, the owner gets 7 days' notice in the window and when they log in; then the shop is foreclosed. Nothing is deleted, and staff can give it back.
- Moving prices: the items of each market you track (fish, pelts, crops... you choose) move once per restart: down when players flood the stores with them, up when they buy them out, and back towards normal over time. Prices show a small ▲ or ▼.
- Commodities exchange: at an exchange desk players buy shares of a market at today's price and sell them after later restarts, with a small fee each way.
- Passers-by: a quiet open shop now and then sells a little to an unseen customer, so owning a shop on a quiet server still pays a little.
- Staff tools in the free Land Office (
/britannia): every setting, the item lists, hand a town store to a player (the clerk leaves) and give it back, every player shop (owner, job, tills, tax owed, foreclose, give back, delete), storefronts, and the moving prices with a reset. - English, Spanish and French.
The Lua is encrypted by Cfx.re; the settings, the item lists and the text stay editable.
Requirements
- poggy_core (free), version 0.14.0 or newer.
- oxmysql.
- One of VORP, RSG Core or QBCore RedM (poggy_core connects the script to it).
- Optional: Land Office (staff tools and settings in game) and Notifications.
Install
- Download it from portal.cfx.re (Assets, Granted Assets) and put the
Britannia_Marketsfolder in your server'sresourcesfolder. - Add this to
server.cfg, after poggy_core and oxmysql: ``ensure Britannia_Markets`` - Add the shop token item (see Items).
- Set your stores in
shared/config.luaand what they trade inshared/catalog.lua. - Restart the server. Its database tables are made for you.
Don't run another market or shop script that uses the same counters.
Items
- VORP: run
SQL.sqlonce. It only adds items your server doesn't have yet. - RSG Core / QBCore RedM: add the item in
installation/items_rsg_qbcore.txtto your items list.
The only item is the shop token, shop_token (usable). To use an item your server already has, set Config.PlayerShops.DeedItem. Every item in shared/catalog.lua must be in your items list; lines naming an unknown item are left out and named in the server console.
Configuration
Everything is in shared/config.lua and shared/catalog.lua, and every option is commented:
| Setting | What it does |
|---|---|
Config.Key, Config.UseDistance, Config.ClerkDistance | The key at a counter, how close it works, when clerks appear |
Config.Payment | Cash and gold on or off, and how many dollars one gold is worth |
Config.StoreTypes | Each kind of store: its name, the catalog lists it sells and buys, blip and clerk |
Config.Stores | The town stores: id, type, spot, and anything that differs from its type (clerk, lists, blip, job lock) |
Config.RestockMinutes | How often sold-out lines come back |
Config.PlayerShops | Shop token item, shops per character, spacing, shelf and buying lines, highest price, staff, job grades, blip |
Config.Roles | The roles an owner can hire and what each may do |
Config.NoShopZones, Config.Storefronts | Places a token can't be used, and fixed shop spots staff hand out |
Config.Tax | On or off, how often, rent, share of sales, days of notice |
Config.Dashboard | Days on the graph, best sellers shown, what counts as slow or low stock |
Config.Economy | Moving prices on or off, the markets and their items, floor, ceiling and how fast prices move |
Config.Exchange | The exchange desks, which markets trade there, share value, fee and limits |
Config.GhostBuyers | Passers-by: how often, how quiet a shop must be, and how much they spend |
Config.Notify | How messages reach players (Britannia Notifications, poggy_core's, or your own) |
Catalog (shared/catalog.lua) | The item lists: what stores sell (price, category, optional stock) and buy |
Commands and permissions
| Command | Who | What it does |
|---|---|---|
| G at a counter | Everyone | Opens the store, shop or exchange desk |
/marketshere <type> <name> | Staff | Prints a ready-made store line for where you stand (and copies it) |
Staff are players with an ace in Config.AdminAces (britannia_markets.admin by default), a group in Config.AdminGroups, or a poggy_core admin. Staff can run any shop and use the Land Office panels.
How it works
Everything is checked on the server: every price, stock count, carrying space, the money in the wallet and the till, and the player's role at a shop, again on every action. A basket is checked first, then paid, then handed over; anything that can't be given is paid back. Prices move only when the server restarts, so nobody can trade on a price that changes under them.
Troubleshooting
Items on my shelf don't show under Buy
A line is only on sale when it has a price and isn't hidden. Lines without a price say "No price, not on sale yet" on the Shelf tab.
"That character already owns 1 shop(s)"
Each character can own Config.PlayerShops.MaxPerPlayer shops. Raise it in the config or the Land Office.
A store doesn't sell an item
The item must be in your items list. Check the server console when the script starts: unknown items are named there.
The clerk faces the wrong way
The fourth number of a store's coords is the way the customer faces the counter; the clerk faces them. Stand at the counter and use /marketshere to get the right line, or set clerkCoords on the store.
Version history
- 1.0.0: first 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