Wasabi Scripts
StoreDiscordGitHub
  • Documentation
  • Dependency
    • 🔗wasabi_bridge
      • Dependencies
      • Installation
      • Configuration
      • Custom Notifications
      • Common Issues & Fixes
  • Advanced Series
    • 🚑wasabi_ambulance
      • Dependencies
      • Installation
      • Configuration
      • Death Screens
      • Exports / Events
      • State Bags
      • Customizations
      • Common Issues
        • QBCore
    • 🩺wasabi_crutch
      • Dependencies
      • Installation
      • Configuration
      • Exports
    • 👮‍♂️wasabi_police
      • Dependencies
      • Installation
      • Configuration
      • Exports
      • State Bags
      • Events
      • Customizations
    • 🔎wasabi_evidence
      • Dependencies
      • Installation
      • Configuration
      • Customizations
    • 🛡️wasabi_adminmenu
      • Dependencies
      • Installation
      • Configuration
    • 👷wasabi_multijob
      • Dependencies
      • Installation
      • Configuration
      • Replace ESX Boss Menus
    • 🔑wasabi_carlock
      • Dependencies
      • Installation
      • Configuration
      • Exports
      • Common Issues
        • QBCore
  • Core UI Series
    • 🖥️wasabi_loadingscreen
      • Configuration
    • 🧑‍🤝‍🧑wasabi_multichar
      • Dependencies
      • Installation
      • Configuration
      • Exports
      • Events
    • 💳wasabi_banking
      • Dependencies
      • Installation
      • Configuration
      • Exports
    • 👼wasabi_spawn
      • Dependencies
      • Installation
      • Configuration
      • Exports
      • Events
    • 🔔wasabi_notify
      • Exports / Events
      • Configuration
      • Change Framework Notify
    • ⏸️wasabi_pausemenu
      • Dependencies
      • Installation
      • Configuration
      • Exports
  • Heist Series
    • 🏦wasabi_pacificrobbery
      • Dependencies
      • Installation
      • Configuration
      • Events
    • 🏦wasabi_paletorobbery
      • Dependencies
      • Installation
      • Configuration
      • Events
    • 🏦wasabi_fleecarobberies
      • Dependencies
      • Installation
      • Configuration
      • Events
  • 💎wasabi_vangelicorobbery
    • Dependencies
    • Installation
    • Configuration
    • Events
  • 🔫wasabi_ammunationrobbery
    • Dependencies
    • Installation
    • Configuration
    • Events
  • 🚢wasabi_yachtheist
    • Dependencies
    • Installation
    • Configuration
    • Events
  • Free Releases
    • 👕fivem-appearance
      • Installation
      • Dependencies
      • Common Issues
      • Snippets
      • Exports
      • Examples
    • 👩‍💻wasabi_discord
      • Installation
      • Exports
Powered by GitBook
On this page
  1. Core UI Series
  2. wasabi_notify

Change Framework Notify

Follow these directions to replace your RP framework's notifications!

Replace QBCore Notifications

QBCore

  1. Open qb-core/client/functions.lua and find:

function QBCore.Functions.Notify(text, texttype, length)
    if type(text) == "table" then
        local ttext = text.text or 'Placeholder'
        local caption = text.caption or 'Placeholder'
        texttype = texttype or 'primary'
        length = length or 5000
        SendNUIMessage({
            action = 'notify',
            type = texttype,
            length = length,
            text = ttext,
            caption = caption
        })
    else
        texttype = texttype or 'primary'
        length = length or 5000
        SendNUIMessage({
            action = 'notify',
            type = texttype,
            length = length,
            text = text
        })
    end
end
  1. Replace with:

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

    if type(text) == 'table' then
        local ttext = text.text or ''
        local caption = text.caption or ''
        exports.wasabi_notify:notify(caption, ttext, length, texttype)
        return
    end
    
    exports.wasabi_notify:notify('Notification', text, length, texttype)
    
end
Replace ESX Notifications

ESX

  1. Open es_extended/client/functions.lua and find:

function ESX.ShowNotification(message, notifyType, length)
    if GetResourceState("esx_notify") ~= "missing" then
        return exports["esx_notify"]:Notify(notifyType, length, message)
    end

    print("[^1ERROR^7] ^5ESX Notify^7 is Missing!")
end
  1. Replace with:

function ESX.ShowNotification(message, type, length)
    if type == 'inform' then type = 'info' end
    exports.wasabi_notify:notify('Notification', message, length, type)
end
Replace ox_lib Notifications

OX_LIB notification replacement

  1. Open ox_lib\resource\interface\client\notify.lua and find:

function lib.notify(data)
    local sound = settings.notification_audio and data.sound
    data.sound = nil

    SendNUIMessage({
        action = 'notify',
        data = data
    })

    if not sound then return end

    if sound.bank then lib.requestAudioBank(sound.bank) end

    local soundId = GetSoundId()
    PlaySoundFrontend(soundId, sound.name, sound.set, true)
    ReleaseSoundId(soundId)

    if sound.bank then ReleaseNamedScriptAudioBank(sound.bank) end
end
  1. Replace with:

function lib.notify(data)
    if data.type == 'inform' then data.type = 'info' end

    if data.position == 'top' or data.position == 'bottom' or
    data.position == 'bottom-right' or
    data.position == 'bottom-left' then
        data.position = 'center'
    end

    if data.position == 'center-right' then data.position = 'right' end
    if data.position == 'center-left' then data.position = 'left' end

    exports.wasabi_notify:advancedNotify({
        type = data.type,
        customType = data.iconColor and { color = data.iconColor, color2 = data.iconColor } or false,
        id = data.id or false,
        title = data.title,
        description = data.description,
        duration = data.duration,
        position = data.position,
        icon = data.icon,
        iconAnimation = data.iconAnimation and 'pulse' or false,
    })
end
PreviousConfigurationNextwasabi_pausemenu

Last updated 1 year ago

🔔