Snippets

Below you can find a tutorial on how you can replace the default framework notifications.

ESX (es_extended)

Open es_extended/client/functions.lua and find the following function:

function ESX.ShowNotification

Replace the entire function with:

function ESX.ShowNotification(message, notifyType, length, title)
    notifyType = notifyType or 'info'
    length = length or 5000
    title = title or 'title'

    exports['cobra-notify']:Notify(notifyType, title, message, length)
end
QBCORE (qb-core)

Open qb-core/client/functions.lua find the following function:

function QBCore.Functions.Notify

Replace the entire function with:

function QBCore.Functions.Notify(text, texttype, length, icon)
    local notifyType = texttype or 'primary'
    if notifyType == 'primary' then notifyType = 'info' end
    local notifyLength = length or 5000

    if type(text) == 'table' then
        notifyTitle = text.caption or 'title'
        notifyMessage = text.text or 'No message found'
    else
        notifyTitle = 'title'
        notifyMessage = text or 'No message found'
    end

    exports['cobra-notify']:Notify(notifyType, notifyTitle, notifyMessage, notifyLength)
end

Last updated