Hello! People keep asking this question, so I decided to make a small tutorial for it. This depends on the notification system you are using, but for this demo purposes we will be using okokNotify.
The file we want to edit is located at ox_lib/resource/interface/client/notify.lua
Line 33 should contain function lib.notify(data)
This function is called whenever we want to display a notification. It accepts data table, more info can be found on COX docs page: https://coxdocs.dev/ox_lib/Modules/Interface/Client/notify#libnotify
In our case, we want to replace ox_lib notify with okokNotify. According to okok docs (https://docs.okokscripts.io/scripts/okoknotify#client-side), we should use this client side export:
exports['okokNotify']:Alert('Title', 'Message', Time, 'type', playSound)
Now we just have to insert this part to the lib.notify function:
function lib.notify(data)
local sound = settings.notification_audio and data.sound
data.sound = nil
data.position = data.position or settings.notification_position
-- We comment this part out because it's the part that shows the default notification
--[[ SendNUIMessage({
action = 'notify',
data = data
}) ]]
-- And we insert the okokNotify code below it
exports['okokNotify']:Alert(data.title, data.description, data.duration or 5000, data.type or 'info', false)
-- Notice that we have replaced "text" with real data passed to this function
-- or is added in case you didn't specify data value
-- "false" at the end means that we won't be playing sound since this is done below by ox
if not sound then return end
if sound.bank then lib.requestAudioBank(sound.bank) end
local soundId = GetSoundId()
PlaySoundFrontend(soundId, sound.name, sound.set, true)
ReleaseSoundId(soundId)
if sound.bank then ReleaseNamedScriptAudioBank(sound.bank) end
end```
I hope instructions were clear and that you also learned something new 🙂

him