Mekez DEV
  • Information
  • PAID RESOURCES
    • 💰Money Wash
      • Installation
      • Configuration
      • Locales
    • 📢Notify v2
      • Usage
      • Installation
  • FREE RESOURCES
    • 🚘Carkeys
      • Installation
      • Configuration
Powered by GitBook
On this page
  • ESX
  • QBCore
  1. PAID RESOURCES
  2. Notify v2

Installation

ESX

On es_extended/client/functions.lua replace the all function ESX.ShowNotification with the following one:

-- Replace ESX notifications
function ESX.ShowNotification(message, type, length)
    if GetResourceState('mkz-notify2') ~= 'missing' then
        local title = "Info"
        local notifyType = "info"
        local duration = length or 5000
        
        if type == 'error' then
            title = "Error"
            notifyType = "error"
        elseif type == 'inform' then
            title = "Info"
            notifyType = "info"
        elseif type == 'success' then
            title = "Success"
            notifyType = "success"
        elseif type == 'warning' then
            title = "Warning"
            notifyType = "warning"
        end
        
        exports['mkz-notify2']:SendNotification({
            title = title,
            message = message,
            type = notifyType,
            duration = duration,
            sound = true
        })
    else
        print('[mkz-notify2]: ERROR: mkz-notify2 resource not FOUND or not STARTED!')
    end
end

QBCore

On qb-core/client/functions.lua replace the function QBCore.Functions.Notify with the following one:

-- Replace QBCore notifications
QBCore.Functions.Notify = function(text, textype, length)
    if textype == 'primary' then textype = 'info' end 
    local ttype = textype ~= nil and textype or "info"
    local length = length ~= nil and length or 5000
    exports['mkz-notify2']:SendNotification({
        title = '',
        message = text,
        type = ttype,
        duration = length,
        sound = true
    })
end
PreviousUsageNextCarkeys

Last updated 1 month ago

📢