Framework Integration
Before modifying any core files, it's recommended that you have at least beginner-level coding experience. Improper edits may cause unexpected issues in your framework.
File: es_extended/client/functions.lua
Replace the default QBox notification with:
function ESX.ShowNotification(message, notifyType, length)
local NotifyType = "info"
if notifyType == 1 or notifyType == "success" then
NotifyType = "success"
elseif notifyType == 0 or notifyType == "error" then
NotifyType = "error"
end
local duration = length or 3000
if GetResourceState("g-notifications") ~= "missing" then
return exports["g-notifications"]:Notify({
title = "Groot Development",
description = message,
duration = duration,
type = NotifyType,
position = "top-right",
})
end
endFile: qb-core/client/functions.lua
Replace the default QBox notification with:
function QBCore.Functions.Notify(text, texttype, length)
local notifyType = texttype or "info"
local notificationDuration = length or 3000
local notificationPosition = "top-right"
if notifyType == "primary" then
notifyType = "info"
elseif notifyType == "warning" then
notifyType = "warn"
end
exports["g-notifications"]:Notify({
title = "Groot Development",
description = text,
type = notifyType,
duration = notificationDuration,
position = notificationPosition,
})
endFile: qbx_core/client/functions.lua
Replace the default QBox notification with:
function Notify(text, notifyTypeo, 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 notifyType = notifyTypeo or "info"
local notificationDuration = duration or 3000
local notificationPosition = "top-right"
if notifyType == "primary" or notifyType == "inform" then
notifyType = "info"
elseif notifyType == "warning" then
notifyType = "warn"
end
exports["g-notifications"]:Notify({
id = title,
title = title,
description = description,
type = notifyType,
duration = notificationDuration,
position = notificationPosition,
})
endLast updated