--[[ ░▒▓████████▓▒░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓███████▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓███████▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░░▒▓███████▓▒░ This File Leaked By TC HUB Team, Join Our Server For More DISCORD: - https://discord.gg/k3S8RjkPWc - https://t.me/+RgDxwPX3L7w2ODBk - https://tchub.shop/ --]] function Notification(icon, header, text) if IsUIV2Started then exports[ZSX_UIV2]:Notification(header, text, icon) else if FrameworkSelected == 'ESX' then ESX.ShowNotification(text, nil, nil, header) elseif GetResourceState('qbx_core') == 'started' then exports['qbx_core']:Notify({ text = text, caption = header, }, nil, nil, nil, nil, nil, icon) elseif FrameworkSelected == 'QBCore' then QBCore.Functions.Notify({ text = text, caption = header, }, nil, nil, icon) end end end function GetActiveTextUI() if Config.TextUI then return Config.TextUI end return GetResourceState("ZSX_UIV2") == "started" and "ZSX_UIV2" or GetResourceState("jg-textui") == "started" and "jg-textui" or GetResourceState("okokTextUI") == "started" and "okokTextUI" or GetResourceState("lation_ui") == "started" and "lation_ui" or GetResourceState("cd_drawtextui") == "started" and "cd_drawtextui" or GetResourceState("ox_lib") == "started" and "ox" or GetResourceState("es_extended") == "started" and "ESX" or false end function ShowTextUI(key, text, zone, parking) local textUI = GetActiveTextUI() if not textUI then return end local formattedText = "[" .. key .. "] " .. text if textUI == "ZSX_UIV2" then exports[ZSX_UIV2]:TextUI_Persistent(key, text, -1, function() if parking then Components.Parking.Init(zone) else if _Zones.ActiveZone and _Zones.ActiveZone.zoneType == "impound" then Impound.Access(zone) else Garage.Access(zone) end end end, function() end) exports['ZSX_UIV2']:TextUI_UpdateTextPersistent(text) elseif textUI == "jg-textui" then exports['jg-textui']:DrawText(formattedText) elseif textUI == "okokTextUI" then exports['okokTextUI']:Open(formattedText, 'darkblue', 'right') elseif textUI == "lation_ui" then exports.lation_ui:showText({ description = tostring(formattedText), position = 'right-center' }) elseif textUI == "cd_drawtextui" then TriggerEvent('cd_drawtextui:ShowUI', 'show', formattedText) elseif textUI == "ox" then lib.showTextUI(formattedText) elseif textUI == "ESX" then ESX.TextUI(formattedText) end end function HideTextUI(success) local textUI = GetActiveTextUI() if not textUI then return end if textUI == "ZSX_UIV2" then exports[ZSX_UIV2]:TextUI_RemovePersistent(false) elseif textUI == "jg-textui" then exports['jg-textui']:HideText() elseif textUI == "okokTextUI" then exports['okokTextUI']:Close() elseif textUI == "lation_ui" then exports.lation_ui:hideText() elseif textUI == "cd_drawtextui" then TriggerEvent('cd_drawtextui:HideUI') elseif textUI == "ox" then lib.hideTextUI() elseif textUI == "ESX" then ESX.HideUI() end end local parkVehicleAwait = GetGameTimer() local function HandleGarageAction(silent) if parkVehicleAwait > GetGameTimer() then if not silent then debugPrint("[^2ZONES^7] [^1PARK_VEHICLE^7] Timeout is active!") end return end if not _Zones or not _Zones.ActiveZone then if not silent then debugPrint("[^2ZONES^7] [^1PARK_VEHICLE^7] No active zone has been found!") end return end if LocalPlayer.state.ZSX_IsInGarage then return end if GetActiveTextUI() == "ZSX_UIV2" then return end if _Zones.CanInteract and not _Zones.CanInteract(_Zones.ActiveZone) then if not silent then debugPrint("[^2ZONES^7] [^1PARK_VEHICLE^7] Active zone is too far away!") end HideTextUI() return end parkVehicleAwait = GetGameTimer() + 1000 debugPrint(("[^2ZONES^7] Using active %s ^2%s^7"):format(_Zones.ActiveZone.zoneType or "zone", _Zones.ActiveZone.name or "unknown")) HideTextUI() if _Zones.ActiveZone.zoneType == "impound" then Impound.Access(_Zones.ActiveZone.name) elseif cache.vehicle then Components.Parking.Init(_Zones.ActiveZone.name) else Garage.Access(_Zones.ActiveZone.name) end Citizen.CreateThread(function() Wait(1000) _Zones.ChangedState = true end) end RegisterCommand("park_vehicle", function() HandleGarageAction() end) RegisterCommand("access_garage", function() HandleGarageAction() end) Citizen.CreateThread(function() while not Translations or not Translations.KeyMapping do Wait(400) end debugPrint("[^2ZONES^7] Garage interaction uses zone-local E control.") end) AddEventHandler('onResourceStop', function(resourceName) if resourceName == GetCurrentResourceName() then HideTextUI() end end) function SetFuel(entity, fuel) if Config.Fuel == 'NOT_FOUND' then return debugPrint("[^2FUEL^7] ^1Could not find any fuel resource.^7") end if not DoesEntityExist(entity) then return debugPrint("[^2FUEL^7] ^1Invalid entity^7") end _import("fuel/" .. Config.Fuel).set(entity, fuel) end function GetFuel(entity) if Config.Fuel == 'NOT_FOUND' then return debugPrint("[^2FUEL^7] ^1Could not find any fuel resource.^7") end if not DoesEntityExist(entity) then return debugPrint("[^2FUEL^7] ^1Invalid entity^7") end return _import("fuel/" .. Config.Fuel).get(entity) end function AddKey(entity, plate) if Config.Keys == 'NOT_FOUND' then return debugPrint("[^2KEYS^7] ^1Could not find any keys resource.^7") end if not DoesEntityExist(entity) then return debugPrint("[^2KEYS^7] ^1Invalid entity^7") end if not plate then plate = Config.TrimVehiclePlatesForKeys and Utils.TrimPlate(GetVehicleNumberPlateText(entity)) or GetVehicleNumberPlateText(entity) end _import("keys/" .. Config.Keys).add(entity, plate) end function RemoveKey(entity, plate) if Config.Keys == 'NOT_FOUND' then return debugPrint("[^2KEYS^7] ^1Could not find any keys resource.^7") end if not DoesEntityExist(entity) then return debugPrint("[^2KEYS^7] ^1Invalid entity^7") end if not plate then plate = Config.TrimVehiclePlatesForKeys and Utils.TrimPlate(GetVehicleNumberPlateText(entity)) or GetVehicleNumberPlateText(entity) end _import("keys/" .. Config.Keys).remove(entity, plate) end