If you want to replace the standard ESX notification with ours, you need to change the following:
Debug = ESX.GetConfig().EnableDebug
local isShowing = false
local function TextUI(message)
isShowing = true
local key, text = message:match("%[(%w)%]%s*(.*)")
if not key then
key = "default"
text = message
end
exports.sc_textUI:showUI(key, text)
end
local function HideUI()
if not isShowing then
return
end
isShowing = false
exports.sc_textUI:hideUI()
end
exports("TextUI", TextUI)
exports("HideUI", HideUI)
ESX.SecureNetEvent("ESX:TextUI", TextUI)
ESX.SecureNetEvent("ESX:HideUI", HideUI)
if Debug then
RegisterCommand("textui:test", function()
TextUI("Press [E] to use")
end, false)
RegisterCommand("textui:hide", function()
HideUI()
end, false)
end