Snippet Codes
Change Framework Notify Snippet Codes!
Replace ESX Notification
ESX
Open
es_extended/client/functions.luaand find:
function ESX.ShowNotification(message, notifyType, length)
if GetResourceState("esx_notify") ~= "missing" then
return exports["esx_notify"]:Notify(notifyType, length, message)
end
print("[^1ERROR^7] ^5ESX Notify^7 is Missing!")
endReplace With:
function ESX.ShowNotification(message, notifyType, length, title, position)
exports['dxs-notify']:ShowNotify(message)
endReplace Ox_Lib Notification
OX_LIB
Open
ox_lib\resource\interface\client\notify.luaand find:
function lib.notify(data)
local sound = settings.notification_audio and data.sound
data.sound = nil
SendNUIMessage({
action = 'notify',
data = data
})
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
endReplace With:
function lib.notify(data)
local sound = settings.notification_audio and data.sound
data.sound = nil
data.position = data.position or settings.notification_position
if GetResourceState("dxs-notify") == "started" then
exports['dxs-notify']:ShowNotify(data.description)
else
SendNUIMessage({
action = 'notify',
data = data
})
end
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
endReplace QBCore Notification
QBCore
Open
qb-core/client/functions.luaand find:
function QBCore.Functions.Notify(text, texttype, length)
if type(text) == "table" then
local ttext = text.text or 'Placeholder'
local caption = text.caption or 'Placeholder'
texttype = texttype or 'primary'
length = length or 5000
SendNUIMessage({
action = 'notify',
type = texttype,
length = length,
text = ttext,
caption = caption
})
else
texttype = texttype or 'primary'
length = length or 5000
SendNUIMessage({
action = 'notify',
type = texttype,
length = length,
text = text
})
end
endReplace With:
function QBCore.Functions.Notify(text, texttype, length)
texttype = texttype or 'info'
if texttype == 'primary' then texttype = 'info' end
length = length or 5000
if type(text) == 'table' then
local ttext = text.text or ''
local caption = text.caption or ''
exports['dxs-notify']:ShowNotify(ttext)
return
end
exports['dxs-notify']:ShowNotify(text)
endLast updated