From ef1b31c0f769dc6f78f8c45c15a0a3f3d1a9cfb1 Mon Sep 17 00:00:00 2001 From: xorzo <80540494+xorzo1@users.noreply.github.com> Date: Wed, 6 Jul 2022 13:53:35 +0200 Subject: [PATCH] Update TextUI.lua --- [esx]/esx_textui/TextUI.lua | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/[esx]/esx_textui/TextUI.lua b/[esx]/esx_textui/TextUI.lua index 5753cd74..b6794a97 100644 --- a/[esx]/esx_textui/TextUI.lua +++ b/[esx]/esx_textui/TextUI.lua @@ -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) \ No newline at end of file +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