πNotifications
Step 1: Finding the notification system
function Notify(title, msg, type)
if type == 'success' then
if SharedConfig.Notify == 'okok' then
exports['okokNotify']:Alert(title, msg, 3000, 'success', true)
elseif SharedConfig.Notify == 'ox' then
lib.notify({
title = title,
description = msg,
type = 'success'
})
elseif SharedConfig.Notify == 'mythic' then
exports['mythic_notify']:DoHudText('success', msg)
elseif SharedConfig.Notify == 'qb' then
QBCore.Functions.Notify({
text = title,
caption = msg,
}, 'success', 3000)
end
elseif type == 'error' then
if SharedConfig.Notify == 'okok' then
exports['okokNotify']:Alert(title, msg, 3000, 'error', true)
elseif SharedConfig.Notify == 'ox' then
lib.notify({
title = title,
description = msg,
type = 'error'
})
elseif SharedConfig.Notify == 'mythic' then
exports['mythic_notify']:DoHudText('error', msg)
elseif SharedConfig.Notify == 'qb' then
QBCore.Functions.Notify({
text = title,
caption = msg,
}, 'error', 3000)
end
end
endStep 2: Implementing your own
Step 3: Make sure to change the server file too!
Step 4: Testing
Last updated