🎯QBox
Tested on
qb-core
resource version1.22.5
. If it doesn't work on a higher version, please report it on Discord.
ONEX NOTIFICATION
Follow these steps to replace the default QBox notifications with ONEX Notification.
MODIFY CLIENT NOTIFICATION FUNCTION
-
Navigate to the Core Folder:
- Go to your
qbx_core
folder. - Open the file:
qbx_core/bridge/qb/client/functions.lua
- Go to your
-
Locate the Notification Function:
- Around line 12, find the function
Notify
.
- Around line 12, find the function
-
Replace the Function:
This is original Function
function Notify(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
lib.notify({
id = title,
title = title,
description = description,
duration = duration,
type = notifyType,
position = position,
style = notifyStyle,
icon = notifyIcon,
iconColor = notifyIconColor
})
end
Replace the current function with the code below:
qbx_core/bridge/qb/client/functions.lua
function Notify(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
TriggerEvent('onex-interaction:client:notify', notifyIcon or false, title or false, 1, description, notifyIconColor, duration)
end
MODIFY SERVER NOTIFICATION FUNCTION
-
Navigate to the Core Folder:
- Go to your
qbx_core
folder. - Open the file:
qbx_core/server/functions.lua
- Go to your
-
Locate the Notification Function:
- Around line 401, find the function
QBCore.Functions.Notify
.
- Around line 401, find the function
-
Replace the Function:
- Replace the current function with the code below:
qbx_core/server/functions.luafunction 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('onex-interaction:client:notify', source, notifyIcon or false, title or false, 1, description, notifyIconColor, duration) end