diff --git a/[esx]/esx_textui/TextUI.lua b/[esx]/esx_textui/TextUI.lua index 2cc04528..37020fbc 100644 --- a/[esx]/esx_textui/TextUI.lua +++ b/[esx]/esx_textui/TextUI.lua @@ -1,16 +1,21 @@ Debug = ESX.GetConfig().EnableDebug - +local IsShowing = false ---@param message any ----@param type string +---@param Type string local function TextUI(message, type) + IsShowing = true SendNUIMessage({ action = 'show', message = message and message or 'ESX-TextUI', - type = type ~= 0 and type or 'info' + type = type == 0 and "info" or type }) end local function HideUI() + if not IsShowing then + return + end + IsShowing = false SendNUIMessage({ action = 'hide' })