Configuration
All options are in config.lua (declared as a shared script, but only the client reads it).
Config = {}
Config.Position = 'bottom-center'
Config.Duration = 6000
Config.MaxVisible = 5
Config.Scale = 0.5
Config.ZIndex = 99998
Config.Title = 'NOTIFICATION'
Config.DedupeWindow = 150
Config.HookQBCore = false
Config.HookESX = false
Config.Sound = {
enabled = true,
file = 'digital-quick-tone.ogg',
volume = 0.1,
}
General
| Key | Type | Default | What it does |
|---|---|---|---|
Config.Position | string | 'bottom-center' | Default position when a call does not specify one, or specifies an unknown one. Must be one of Config.Positions |
Config.Duration | number (ms) | 6000 | Default display time. The NUI enforces a minimum of 1500 ms on every card |
Config.MaxVisible | number | 5 | Cards shown at the same time per position. Further cards wait in that position's queue |
Config.Scale | number | 0.5 | Size of the card relative to the original 1080p mock-up (1.0 = full size, 0.5 = half). Font sizes are rounded to whole pixels with a floor of 10 px for the message and 9 px for the title |
Config.Title | string | 'NOTIFICATION' | Title shown when a call has neither title nor caption |
Config.DedupeWindow | number (ms) | 150 | If the same message, type and title arrive again within this window, the second call is dropped. Protects against a notification routed through two paths. 0 disables |
Config.ZIndex | number or false | 99998 | Z-index of the notification frame among all NUI frames. 99998 is above every HUD and chat and just below the resource that currently has NUI focus (FiveM gives that one 99999). Re-applied every 250 ms because each SetNuiFocus call re-stacks all frames. false disables. Needs a client with the SetNuiZindex native; older clients ignore it |
Config.HookQBCore | boolean | false | Registers a handler for the QBCore:Notify net event. Only for servers that did not patch qb-core; otherwise every server-sent notification shows twice |
Config.HookESX | boolean | false | Registers handlers for esx:showNotification and esx:showAdvancedNotification. Skipped automatically if the resource is named esx_notify. Leave off when es_extended is patched |
Sound
| Key | Default | What it does |
|---|---|---|
Config.Sound.enabled | true | Master switch, sent to the NUI once at start |
Config.Sound.file | 'digital-quick-tone.ogg' | File in html/sounds played for every card that does not override it |
Config.Sound.volume | 0.1 | 0 to 1 |
Files shipped in html/sounds: digital-quick-tone.ogg (default), confirmation-tone.ogg, correct-answer-tone.ogg. Add your own .ogg to that folder and reference it by name. A per-type sound key in Config.Types and a per-call sound field override the default; sound = false in a call mutes that one card.
Positions
Config.Positions lists the nine valid values. Each has its own stack and queue.
Config.Positions = {
'top-left', 'top-center', 'top-right',
'left-center', 'center', 'right-center',
'bottom-left', 'bottom-center', 'bottom-right',
}
Cards enter from the side they are anchored to: from the right on the right-hand positions, from the left on the left-hand ones, from the top or bottom for the centre columns, and with a scale-and-blur fade for center.
Types
Each type has an icon in html/icons and an accent colour used for the bar and the ×N counter.
| Type | Icon | Colour |
|---|---|---|
car | car.png | #c054f6 |
error | error.png | #ea3052 |
heart | heart.png | #af4ef6 |
house | house.png | #2da7f7 |
info | info.png | #c178f7 |
location | location.png | #c75cf6 |
money | money.png | #f5ae20 |
objective | objective.png | #765ef6 |
question | question.png | #2799f6 |
success | success.png | #45d577 |
warning | warning.png | #f58d1d |
To add a type, add an entry mytype = { icon = 'mytype.png', color = '#hex' } and drop the PNG into html/icons (320 × 320 with transparency, like the shipped ones). An optional sound = 'file.ogg' gives the type its own sound.
Aliases
Config.Aliases maps the type names used by frameworks and other scripts onto the types above. Lookups are case-insensitive; an unknown name falls back to info.
| Alias | Becomes |
|---|---|
primary, inform, information | info |
warn | warning |
fail | error |
police, target, mission | objective |
ambulance | heart |
cash, bank | money |
vehicle | car |
home, property | house |
gps | location |