Skip to main content

Configuration

All configuration is in config.lua. The resource works correctly with default values — only change what you need.

Options

KeyDefaultDescription
Config.Locale'es'Language for the resource's own texts (/testnotify). 'en' or 'es'. Does not affect text sent by other scripts.
Config.Position'top-right'On-screen position. Options: 'top-right', 'top-left', 'top-center', 'bottom-right', 'bottom-left', 'bottom-center'.
Config.DefaultDuration4500Time on screen (ms) when the caller does not specify a duration.
Config.MaxVisible5Maximum notifications visible at once. Oldest ones are removed when the limit is reached.
Config.SoundtruePlay a subtle UI sound on each notification.
Config.OverrideFrameworktrueReplaces ESX.ShowNotification and routes QBCore:Notify / esx:showNotification automatically.
Config.DefaultType'info'Notification type used when the caller does not specify one.
Config.Types(table)Per-type appearance: accent (left bar + glow colour) and icon for each of success, error, info, warning.

Usage from any client script

-- Direct export (recommended)
exports['fr_notify']:Send('Vehicle saved.')
exports['fr_notify']:Send({ type = 'success', title = 'Garage', message = 'Stored.', duration = 4000 })
exports['fr_notify']:Success('Saved!', 'Garage')
exports['fr_notify']:Error('Not enough money')
exports['fr_notify']:Info('Press E to interact')
exports['fr_notify']:Warning('Restart in 5 minutes')

Safe pattern with fallback

local function Notify(msg, ntype)
if GetResourceState('fr_notify') == 'started' then
exports['fr_notify']:Send({ type = ntype or 'info', message = msg })
else
ESX.ShowNotification(msg) -- ESX fallback
end
end

From the server

TriggerClientEvent('fr_notify:send', source, { type = 'error', message = 'You are wanted.' })