Overview
Britannia Mail gives every character a PO box and an old writing desk to read and write their post. Letters arrive as envelopes in a tray, open on paper and are sealed with wax. Players can send postcards and parcels, make their own stamps, and keep their post in order with folders, sorting rules and an address book.
- Register a PO box at any post office, free or for a price, and choose its number.
- Write letters to up to 5 PO boxes, or send them anonymously.
- Postcards with a printed "Greetings from <town>" front or the player's own picture.
- Parcels: send up to 2 kinds of item with a letter.
- Custom stamps made from a picture link, and a postmark on every letter.
- Inbox, Starred, Sent and your own folders, with search and sorting rules.
- An address book, and a Directory of businesses and services by job.
- Letters arrive at once. Online players get a notice (or see a pigeon fly), and an envelope in the corner of the screen shows how many are unread.
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).
Install
- Download
Britannia_Mailfrom portal.cfx.re → Assets → Granted Assets. - Put the
Britannia_Mailfolder in your server'sresourcesfolder. - Add
ensure Britannia_Mailtoserver.cfg, afterensure oxmysqlandensure poggy_core. - Restart the server.
- Set your post offices, prices and the Directory's jobs in
shared/config.lua. - Make it yours: replace
html/img/stamp_logo.pngwith your server's logo (shown on the post office's own stamp, the ready-made postcards and the desk), andhtml/img/card_photo.jpgwith a picture for the "Old photograph" postcard. The post office's name and the postcard wording are inlocales/en.lua.
There is no SQL to run and no items to add. The database tables are created automatically on the first start: britannia_mail_boxes, britannia_mail_letters, britannia_mail_copies, britannia_mail_contacts, britannia_mail_folders, britannia_mail_rules, britannia_mail_stamps and britannia_mail_meta.
After changing any file listed in fxmanifest.lua (for example the pictures), run refresh and then ensure Britannia_Mail.
Configuration
The script is encrypted with Cfx.re asset escrow. shared/config.lua and the files in locales/ stay editable, and every option in the config is commented.
| Setting | What it does | Default |
|---|---|---|
Config.Locale | Language file to use from locales/ | 'en' |
Config.Command | Chat command that opens your mail. false turns it off | 'mail' |
Config.LocationOnly | true: mail only opens at a post office or mailbox prop (no /mail) | false |
Config.PigeonOnSend | A pigeon flies off when you send a letter away from a post office | true |
Config.UiSize | How much of the screen the desk takes up (0.5 is half, 1.0 is all of it) | 0.8 |
Config.OpenKey | Prompt key at post offices and mailboxes | G (0x760A9C6F) |
Config.UnreadBadge | Envelope in a corner of the screen showing unread letters, and which corner | on, 'bottom-right' |
Config.MailboxProp | A mailbox prop anywhere in the world also opens the post | off, 'p_mailbox01x' |
Config.RegisterPrice | Cash to register a PO box (0 is free) | 0 |
Config.PickNumber | Players choose their own PO box number (blank takes the next free one) | true |
Config.MaxBox | Highest PO box number a player can choose | 9999 |
Config.StaffBoxes | Numbers kept for staff; only admins can take them. false keeps none | { From = 1, To = 10 } |
Config.ShowSenderName | false: letters show only the sender's PO box number, not their name | true |
Config.MaxRecipients | Most PO boxes one letter can go to | 5 |
Config.MaxBody | Longest letter, in characters | 3000 |
Config.SendCooldown | Seconds between letters, per player | 5 |
Config.AllowAnonymous | Players may send letters without their name or PO box | true |
Config.Parcels | Parcels on or off, most kinds of item, most items in total, and items that can never be posted | on, 2 kinds, 50 items |
Config.Postcards | Postcards on or off, longest message, and the towns for the printed fronts | on, 300 characters, 12 towns |
Config.Stamps | Stamps on or off, most stamps per PO box, and the staff command | on, 8, 'removestamps' |
Config.Directory | Jobs listed in the Directory, with their category and department name | 7 jobs (sheriff, doctor, trades, saloon, store) |
Config.PostOffices | Every post office: position, map blip and name | Post offices across the map |
A Directory line looks like this. job is the job's name on your server:
{ job = 'doctor', category = 'Medical', department = 'Doctor' },Commands and permissions
| Command / key | Who | What it does |
|---|---|---|
/mail | Everyone | Opens your mail anywhere. The name is Config.Command. Off when Config.LocationOnly is true. |
G at a post office | Everyone | Opens the post. Registering a PO box only works here. |
G at a mailbox prop | Everyone | Opens the post, when Config.MailboxProp is on |
/removestamps <PO box> | Admins (and the server console) | Removes every stamp that PO box made, and takes them off the letters it sent. The name is Config.Stamps.AdminCommand. |
Admins are the framework's admin groups, as poggy_core reads them. Only admins can register the staff PO box numbers in Config.StaffBoxes.
How it works
- PO boxes. At a post office, a player registers a PO box. They can pick a free number, or leave it blank to get the next one. Each character has one PO box.
- Letters. Write to up to 5 PO boxes, or from the address book. Letters arrive at once. Players who are online get a notice, and players logging in hear about any unread letters.
- Postcards. Pick a printed "Greetings from <town>" front, or paste a direct link to a picture, then write a short message on the back. The recipient flips it over to read it.
- Parcels. Attach up to 2 kinds of item to a letter. The items leave the sender's inventory straight away, and the recipient collects them from the letter. A parcel can only go to one PO box, and can't go with an anonymous letter or a postcard. Only plain items can be posted: items with metadata (such as durability) are left out.
- Stamps. Players make stamps from a direct
httpslink to a.png,.jpg,.gifor.webppicture, and stamp their letters with them. Every letter gets a postmark. - Keeping it tidy. Star, move, search and delete letters. Make folders, and sorting rules that send letters straight into a folder when the subject or sender contains a word.
- Directory. Lists the characters who have one of the jobs in
Config.Directoryand a PO box, grouped by category.
Troubleshooting
"You need to be at a post office."
A PO box can only be registered at a post office. Walk up to one and press G.
/mail does nothing
Config.LocationOnly is true, or Config.Command is false. Players then open the post at a post office (or a mailbox prop).
"PO Boxes 1 to 10 are kept for staff."
Those numbers are in Config.StaffBoxes. Only admins can take them. Change the range, or set it to false.
"The post office is still opening. Try again in a moment."
The script is still setting up its tables after a start. Make sure oxmysql and poggy_core start before Britannia_Mail.
An item can't be added to a parcel
It's on Config.Parcels.Blacklist, or it carries metadata such as durability. Only plain items can be posted.
A stamp or postcard picture is refused
The link must be a direct https link ending in .png, .jpg, .gif or .webp.
"The clerk is still sorting your last letter."
Players must wait Config.SendCooldown seconds between letters.
Someone is missing from the Directory
They need a PO box and one of the jobs in Config.Directory, spelled exactly as the job is named on your server.
Version history
- 1.0.1: current 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