For the complete documentation index, see llms.txt. This page is also available as Markdown.

Global Notifications Integration

If you want to route all default framework notifications (like job payouts, item usage, and system alerts) through the sleek ak47_hud notification system, you can easily set up a gateway inside your core framework files.

By making these simple changes, your framework will automatically check if the HUD is running. If it is, it uses the custom UI; if you ever stop the HUD, it safely falls back to the default notifications!

Choose your framework below and follow the steps.

🟢 ESX Integration

File to Edit: es_extended/client/functions.lua

  1. Open the file and search for function ESX.ShowNotification.

  2. Delete that entire function, along with function ESX.ShowAdvancedNotification right below it.

  3. Replace them with the following code:

function ESX.ShowNotification(message, notifyType, length, title, position)
    if GetResourceState('ak47_hud') == 'started' then
        return exports['ak47_hud']:Notify(message, notifyType, length, title)
    end
    return IsResourceFound('esx_notify') and exports['esx_notify']:Notify(notifyType or "info", length or 5000, message, title, position)
end

function ESX.ShowAdvancedNotification(sender, subject, msg, textureDict, iconType, flash, saveToBrief, hudColorIndex)
    if GetResourceState('ak47_hud') == 'started' then
        return exports['ak47_hud']:Notify(msg, 'info', 7000, sender)
    end
    
    AddTextEntry("esxAdvancedNotification", msg)
    BeginTextCommandThefeedPost("esxAdvancedNotification")
    if hudColorIndex then
        ThefeedSetNextPostBackgroundColor(hudColorIndex)
    end
    EndTextCommandThefeedPostMessagetext(textureDict, textureDict, false, iconType, sender, subject)
    EndTextCommandThefeedPostTicker(flash, saveToBrief == nil or saveToBrief)
end

🔵 QBCore Integration

File to Edit: qb-core/client/functions.lua

  1. Open the file and search for function QBCore.Functions.Notify.

  2. Highlight the entire function and replace it with the following code:

🟣 ox_lib Integration

File to Edit: ox_lib/resource/interface/client/notify.lua (or search your ox_lib files for function lib.notify)

  1. Open the file and locate function lib.notify(data).

  2. Highlight the entire function block and replace it with the following code:

Important Note: Whenever you update es_extended, qb-core, or ox_lib to a new version from their respective GitHub repositories, you may need to re-apply these changes, as updating core files will overwrite your modifications.

Last updated