sd-notify is a clean and modern notification script for FiveM, supporting various notification types, durations, and even custom sounds.
Click the thumbnail to view a brief video showcase of light & dark mode.
Author: Samuel#0008
Discord: Join the Discord
Store: Click Me
- Download the latest release from the GitHub repository.
- Extract the downloaded file and rename the folder to
sd-notify. - Place the
sd-notifyfolder into your server'sresourcesdirectory. - Add
ensure sd-notifyto yourserver.cfgto ensure the resource starts with your server.
exports['sd-notify']:Notify('Title', 'This is a notification text', 'success', 3000, 'fa-solid fa-check-circle', 'notification_sound.ogg')TriggerClientEvent('sd-notify:Notify', source, 'Title', 'This is a notification text', 'error', 5000, 'fa-solid fa-exclamation-circle', 'error_sound.ogg')- title (optional): The title of the notification. If left empty, a default title will be used based on the notification type. Example of no title:
exports['sd-notify']:Notify('', 'You Failed!', 'error', 2000)
- text: The main content of the notification.
- type: The type of notification. Options include:
success(green)primary(blue)warning(yellow)error(red)
- length (optional): The duration the notification will be displayed, in milliseconds (e.g.,
2000for 2 seconds). If not specified, it defaults to the value set inconfig.js. - icon (optional): The FontAwesome icon class to display. If not specified, it defaults to the value set in
config.js. - sound (optional): The sound to play with the notification. If not specified, it defaults to the value set in
config.js.
To use a custom sound:
- Create a short sound snippet and save it as a
.ogg,.wav, or.mp3file in thesoundsdirectory. - Use the filename (with extension) when calling the
Notifyfunction.
exports['sd-notify']:Notify('ERROR', 'Something went wrong!', 'error', 5000, 'fa-solid fa-bomb', 'custom_error_sound.ogg')local function PlaceBomb(success)
if success then
bombplant()
else
exports['sd-notify']:Notify('ERROR', 'You Failed!', 'error', 5000)
end
endlocal function DoSomething()
local hasMoney = GetPlayerAccountFunds(src, 'money', Config.RunCost)
if hasMoney < Config.RunCost then
TriggerClientEvent('sd-notify:Notify', source, 'ERROR', "You don't have enough cash!", 'error', 5000)
return
end
TriggerEvent('sd-oxyrun:server:startrun')
endFor QBCore, replace the default QBCore.Functions.Notify function with the following:
function QBCore.Functions.Notify(text, texttype, length)
exports['sd-notify']:Notify('', text, texttype, length)
endThis integration will ensure that all notifications triggered by QBCore.Functions.Notify are handled by sd-notify.