Converting Notifications
To Envi-Hud
Replacing all ox_lib notifications with Envi-Hud
Navigate to
ox_lib/resource/interface/client/notify.luaFind the
lib.notifyfunctionReplace the entire function with the following:
function lib.notify(data) local sound = settings.notification_audio and data.sound data.sound = nil data.position = data.position or settings.notification_position if data.type == 'inform' then data.type = 'info' end exports['envi-hud']:Notify({ type = data.type, message = data.description, title = data.title, duration = data.duration }) 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
Replacing all ESX notifications with Envi-Hud
Navigate to
es_extended/client/functions.luaFind the
ESX.ShowNotificationfunctionReplace the entire function with the following:
function ESX.ShowNotification(message, type, length) exports['envi-hud']:Notify({ type = type, message = message, title = '', duration = length or 5000 }) end
Replacing all Qbox notifications with Envi-Hud
Navigate to
qbx_core/client/functions.luaFind the
NotifyfunctionReplace the entire function with the following:
function Notify(text, notifyType, duration, subTitle, notifyPosition, notifyStyle, notifyIcon, notifyIconColor) local title, description if type(text) == 'table' then title = text.title or text.text or '' description = text.message or text.description or text.caption or '' notifyType = text.type or notifyType duration = text.duration or duration elseif subTitle then title = text description = subTitle else description = text end exports['envi-hud']:Notify({ type = notifyType or 'info', message = description, title = title or '', duration = duration or 5000 }) endNavigate to
qbx_core/server/functions.luaFind the
NotifyfunctionReplace the entire function with the following:
function Notify(source, text, notifyType, duration, subTitle, notifyPosition, notifyStyle, notifyIcon, notifyIconColor) local title, description if type(text) == 'table' then title = text.text or 'Placeholder' description = text.caption or nil elseif subTitle then title = text description = subTitle else description = text end local position = notifyPosition or positionConfig TriggerClientEvent('envi-hud:notify', source, { title = title, message = description, duration = duration, type = notifyType, }) end
Replacing QB Core Notifications with Envi-Hud
Navigate to
qb-core/client/functions.luaFind the
QBCore.Functions.NotifyfunctionReplace the entire thing with the following
function QBCore.Functions.Notify(text, texttype, length, icon) if texttype == 'primary' then texttype = 'info' end exports['envi-hud']:Notify({ type = texttype or 'info', message = type(text) == 'table' and text.text or text, title = type(text) == 'table' and text.caption or nil, duration = length or 5000, icon = icon }) end
Away from Envi-Hud
Navigate to
envi-hud/client/client_open.luaFind the
NotifyfunctionReplace the code in this function with whatever notification script you would like to use
There are too many notification scripts to add all of them to these docs, so you'll need to check the documentation for the notification script you're going to be using
Last updated