okokDocs
  • About Us
  • Scripts
    • okokVehicleControl
      • Config file
    • okokMechanicJob
      • Config file
    • okokPoliceJob
      • Config file
      • qb-inventory support
    • okokBossMenu
      • Config file
    • okokMulticharacter
      • Config file
    • okokPhone
    • okokSpawnSelector
      • Config file
      • qb-multicharacter support
    • okokLoadingScreen
      • Config file
    • okokVehicleSales
      • Config file
    • okokShop
      • Config file
    • okokGasStation
      • Config file
    • okokTuning
      • Config file
    • okokGarage
      • Config file
      • RGB vehicle colors
      • Inventories metadata
      • Housing integrations
      • qb-phone support
    • okokVehicleShop
      • Config file
      • Common errors
    • okokBanking
      • Config file
      • Paycheck transactions
      • Registering transactions
    • okokMarketplace
      • Config file
      • Common errors
    • okokChat
      • Config file
      • Export
    • okokBilling
      • Config file
      • Snippets
    • okokCrafting
      • Config file
    • okokContract
      • Config file
    • okokTalkToNPC
      • Config file
    • okokReports
      • Config file
    • okokNotify
      • Config file
      • Snippets
    • okokTextUI
      • Config file
      • Snippets
    • okokRequests
    • okokDeleteVehicles
      • Config file
  • Others
    • Discord Webhook
Powered by GitBook
On this page
  • ESX
  • QBCore
  1. Scripts
  2. okokNotify

Snippets

ESX

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

function ESX.ShowNotification(message, type, length)
    if GetResourceState('okokNotify') ~= 'missing' then
        if type == 'error' then
            exports['okokNotify']:Alert("Error", message, 5000, 'error')
        elseif type == 'inform' then
            exports['okokNotify']:Alert("Info", message, 5000, 'info')
        elseif type == 'success' then
            exports['okokNotify']:Alert("Success", message, 5000, 'success')
        elseif type == 'warning' then
            exports['okokNotify']:Alert("Warning", message, 5000, 'warning')
        else
            exports['okokNotify']:Alert("Info", message, 5000, 'info')
        end
    else
        print('[okokNotify]: ERROR: okokNotify 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:

function QBCore.Functions.Notify(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['okokNotify']:Alert("", text, length, ttype)
end
PreviousConfig fileNextokokTextUI

Last updated 1 year ago