local GUI = {}
GUI.Time = 0
GUI.PoliceCadIsShowed = false
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
ESX.UI.Menu.RegisterType('cadsystem', OpenCadSystem, CloseCadSystem)
end)
function OpenCadSystem()
local playerPed = GetPlayerPed(-1)
GUI.PoliceCadIsShowed = true
SendNUIMessage({
showCadSystem = true,
})
ESX.SetTimeout(250, function()
SetNuiFocus(true, true)
end)
end
function CloseCadSystem()
local playerPed = GetPlayerPed(-1)
SendNUIMessage({
showCadSystem = false
})
SetNuiFocus(false)
GUI.PoliceCadIsShowed = false
ClearPedTasks(playerPed)
end