Installation
Installation
To install sd-notify, drag and drop the file into your resources folder, and ensure it.
Displaying a Notification
Client-Side
Server-Side
Types:
success (green)
primary (blue)
warning (yellow)
error (red)
Length:
1000 - 1 second.
If Length, Icon, Sound remain undefined, it will default to the things set in the config.js
If 'Title' is simply nothing like this:
exports['sd-notify']:Notify(' ', 'You Failed!, 'error', 2000)
' then it will default to a standard message for the type, eg. if it's error it will say Error as the title and so on.
Using your own sound
Create a short sound snippet and save it to the sounds
directory. Make sure it's a .ogg file, since this will have the least filesize for a better load time. But you can use .wav or .mp3. When you want to use this in your notification, make sure you only use filename and file extension e.g. audio_name.ogg
Examples & Integration
Client-Side Integration Example:
Server-Side Integration Example:
Quick QBCore Integration:
Find QBCore.Function.Notify (qb-core/client/functions.lua) and replace what's there, with the following export like this, since QBCore doesn't natively have a title, we'll stick to what was advised above and just leave the Title field blank.
Last updated