Advanced
Notifications
Choose how purchase messages are shown.
Config.Notify controls how messages (purchase success, errors, etc.) are displayed.
config.lua
Config.Notify = {
system = 'framework',
title = 'Market',
duration = 5000,
options = nil,
Custom = function(message, notifyType)
-- exports['my-notify']:Alert(notifyType, message, Config.Notify.duration)
end,
}
| Key | Type | Description |
|---|---|---|
system | string | Which notification system to use: 'framework', 'event' or 'custom'. |
title | string | Title used by the event system. |
duration | number | How long notifications stay (ms). |
options | any | Extra options passed to the event system. |
Custom | function | Your handler for the custom system. |
system = 'framework' (default)
Uses your framework's built-in notify:
- ESX:
ShowNotification - QBCore / QBox:
Functions.Notify(message, type, duration)
Nothing extra to set up — recommended for most servers.
system = 'event'
Sends notifications by triggering a client event that your own notification resource listens for:
TriggerClientEvent('your-notify:Notify', source, title, text, type, length, options)
Use this if you run a custom notify resource that reacts to a client event. Point it at whatever event name your resource expects, and the title, duration and options config values are passed along.
The event name above is just an example — replace
your-notify:Notify with the event your notification resource actually listens for.system = 'custom'
Calls your own function for every notification on the client:
config.lua
Config.Notify = {
system = 'custom',
duration = 5000,
Custom = function(message, notifyType)
exports['my-notify']:Alert(notifyType, message, Config.Notify.duration)
end,
}
| Param | Description |
|---|---|
message | The text to show. |
notifyType | 'success', 'error', 'info' or 'warning'. |
If
system = 'custom' but Custom isn't a function, it safely falls back to framework.The text of each message comes from your locale file, not from
Config.Notify. To change wording, edit the notify section of your locale — see Localization.
