Scripts Guides
Qbcore

🎯QBCore

Tested on qb-core resource version 1.3.0. If it doesn't work on a higher version, please report it on Discord.

ONEX NOTIFICATION

Follow these steps to replace the default QBCore notifications with ONEX Notification.

MODIFY CLIENT NOTIFICATION FUNCTION

  1. Navigate to the Core Folder:

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

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

This is original Function

 
 function QBCore.Functions.Notify(text, texttype, length, icon)
     local message = {
         action = 'notify',
         type = texttype or 'primary',
         length = length or 5000,
     }
 
     if type(text) == 'table' then
         message.text = text.text or 'Placeholder'
         message.caption = text.caption or 'Placeholder'
     else
         message.text = text
     end
 
     if icon then
         message.icon = icon
     end
 
     SendNUIMessage(message)
 end
 

Replace the current function with the code below:

qb-core/client/function.lua
 function QBCore.Functions.Notify(text, texttype, length, icon)
     local message = {
         action = 'notify',
         type = texttype or 'primary',
         length = length or 5000,
     }
 
     if type(text) == 'table' then
         message.text = text.text or 'Placeholder'
         message.caption = text.caption or 'Placeholder'
     else
         message.text = text
     end
 
     if icon then
         message.icon = icon
     end
 
     TriggerEvent('onex-interaction:client:notify', message.icon or false,  message.caption or false, 1, message.text, message.type == 'primary' and '#00FF85' or '#ff0039', message.length)
 end

MODIFY SERVER NOTIFICATION FUNCTION

  1. Navigate to the Core Folder:

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

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

    • Replace the current function with the code below:
    qb-core/server/function.lua
    function QBCore.Functions.Notify(source, text, type, length)
        TriggerClientEvent('onex-interaction:client:notify', source, false, false, 1, text, type == 'primary' and '#00FF85' or '#ff0039', length)
    end