Update TextUI.lua

This commit is contained in:
xorzo
2022-07-06 13:53:35 +02:00
committed by GitHub
parent 0f37070078
commit ef1b31c0f7
+23 -1
View File
@@ -1,3 +1,7 @@
Debug = false
---@param message any
---@param type string
local function TextUI(message, type)
SendNUIMessage({
action = 'show',
@@ -15,4 +19,22 @@ end
exports('TextUI', TextUI)
exports('HideUI', HideUI)
RegisterNetEvent('ESX:TextUI', TextUI)
RegisterNetEvent('ESX:HideUI', HideUI)
RegisterNetEvent('ESX:HideUI', HideUI)
if Debug then
RegisterCommand("textui:error", function()
TriggerEvent("ESX:TextUI", "i ~r~love~s~ donuts", "error")
end)
RegisterCommand("textui:success", function()
TriggerEvent("ESX:TextUI", "i ~r~love~s~ donuts", "success")
end)
RegisterCommand("textui:info", function()
TriggerEvent("ESX:TextUI", "i ~r~love~s~ donuts", "info")
end)
RegisterCommand("textui:hide", function()
TriggerEvent("ESX:HideUI")
end)
end