Overview
Britannia_Notifications gives your server one notification style, so players always know what to expect.
- A dark panel with a thin gold frame, top right by default.
- Four kinds, each with its own colour and mark: info, success, warning and error. An optional title.
- Messages stack (newest on top), and the same message sent again only counts up (×2, ×3…) instead of piling up.
- A thin line runs down each message until it leaves.
- Every player can move it:
/notificationsdims the screen and shows sample messages to drag where they like. Their spot is remembered on their PC. - English, Spanish and French.
Britannia scripts use it automatically when it is running (their Config.Notify setting, coming in each script's next update).
Requirements
None. It works on any RedM server and framework.
Install
- Download
Britannia_Notifications.zipfrom the store and unzip it. - Put the
Britannia_Notificationsfolder in your server'sresourcesfolder. - Add
ensure Britannia_Notificationstoserver.cfg, before the scripts that use it. - Restart the server.
Items
None.
Configuration
Everything is in shared/config.lua, and every option is commented.
| Setting | What it does | Default |
|---|---|---|
Config.Locale | Language: en, es or fr | 'en' |
Config.Position | Where the box starts: top and right, in % of the screen | 7 / 1.2 |
Config.Duration | How long a message stays (ms) when the script sending it doesn't say | 6000 |
Config.MaxVisible | The most messages shown at once | 4 |
Config.MergeRepeats | The same message again counts up instead of stacking | true |
Config.Width | The box's width in pixels at 1080p (it scales with the screen) | 360 |
Config.Kinds | Each kind's colour and mark | gold, green, amber, red |
Config.Sound | A sound when a message shows (false = silent) | false |
Config.Command | The command to move the box | notifications |
Config.TestCommand | Shows one message of each kind (false = no command) | notificationstest |
Commands and permissions
/notifications: move the box (drag it, then Save; Put it back returns it to where it started)./notificationstest: show one message of each kind.
Both are for every player.
How it works
From your own scripts. On the client:
exports.Britannia_Notifications:Notify('Your text', 'success', 5000)
exports.Britannia_Notifications:Notify({ title = 'Butcher', text = 'Sold for $12.00', kind = 'success', duration = 5000 })On the server, to one player (or -1 for everyone):
exports.Britannia_Notifications:Notify(source, 'Your text', 'error')Or with an event: TriggerClientEvent('Britannia_Notifications:notify', source, text, kind, duration).
kind is info, success, warning or error (inform, primary and danger work too).
Britannia scripts. From their next updates, each one has a Config.Notify setting: 'auto' (this box when it runs, otherwise poggy_core's notifications), 'britannia', 'poggy', or 'custom' to use any other notification script through Config.CustomNotify.
Troubleshooting
Nothing shows
Make sure ensure Britannia_Notifications comes before the scripts that use it, then try /notificationstest.
The box is in the wrong place for one player
They can type /notifications and press Put it back.
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