local Targets = {} if Config.ATMs.enable then CreateThread(function() -- Automatic detection of models and make targets and blips while true do local pedCoords = GetEntityCoords(PlayerPedId()) for _, v in pairs(GetGamePool('CObject')) do for _, model in pairs(Config.ATMs.ATMModels) do if GetEntityModel(v) == model then local name, entCoords = getScript()..":ATMLocation:"..v, GetEntityCoords(v) if #(pedCoords - entCoords) <= 150 then if not Targets[name] then Targets[name] = createCircleTarget({name, vec3(entCoords.x, entCoords.y, entCoords.z+1.03), 0.5, { name=name, debugPoly = debugMode, useZ=true, },}, { { action = function() lookEnt(v) TriggerEvent(getScript()..":Client:ATM") end, icon = "fas fa-money-check-alt", label = locale("target", "atm"), }, }, 1.5) end if Config.ATMs.showBlips then if not DoesBlipExist(GetBlipFromEntity(v)) then makeEntityBlip({entity = v, sprite = 434, col = 3, name = "ATM" }) end end else removeZoneTarget(name) Targets[name] = nil if DoesBlipExist(GetBlipFromEntity(v)) then RemoveBlip(GetBlipFromEntity(v)) end end end end end Wait(5000) end end) end RegisterNetEvent(getScript()..":Client:ATM", function() local setheader = nil --this grabs all the info from names to savings account numbers in the databases local info = triggerCallback(getScript()..":GetInfo") playAnim("amb@prop_human_atm@male@enter", "enter", 2000, 1) if progressBar({ label = locale("menu", "acc_atm"), time = 3000 }) then local Menu = {} Menu[#Menu+1] = { isMenuHeader = true, header = locale("menu", "welcome")..info.name, txt = info.cid, } Menu[#Menu+1] = { isMenuHeader = true, header = locale("menu", "header_balance"), txt = locale("menu", "bank_balance")..cv(info.bank)..br..locale("menu", "cash_balance")..cv(info.cash) } Menu[#Menu+1] = { header = locale("menu", "withdraw"), onSelect = function() atmWithdrawl(info) end, } local header = locale("menu", "header_atm") if Config.System.Menu == "qb" then header = "