Scripts Guides
Qbox

🎯QBox

Tested on qb-core resource version 1.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

  1. Navigate to the Core Folder:

    • Go to your qbx_core folder.
    • Open the file:
      qbx_core/bridge/qb/client/functions.lua
  2. Locate the Notification Function:

    • Around line 12, find the function Notify.
  3. 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

  1. Navigate to the Core Folder:

    • Go to your qbx_core folder.
    • Open the file:
      qbx_core/server/functions.lua
  2. Locate the Notification Function:

    • Around line 401, find the function QBCore.Functions.Notify.
  3. Replace the Function:

    • Replace the current function with the code below:
    qbx_core/server/functions.lua
     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('onex-interaction:client:notify', source,  notifyIcon or false,  title or false, 1, description, notifyIconColor, duration)
     end