Install guide

  1. Download the esx_realistic_atm resource.

  2. Move the esx_realistic_atm folder into your server's resources directory.

  3. Open your server configuration file (default: server.cfg)

  4. Add the following line to ensure the resource is started when the server runs:

    ensure esx_realistic_atm
  5. Remove/Modify your banking scripts that handle ATM opening or PIN code management (if using cached pincodes).

  6. Start the server

esx_banking:

Go to client/main.lua (~line 17)

CreateThread(function ()
            while playerLoaded do
                data.coord = GetEntityCoords(data.ped)
                data.ped = PlayerPedId()
                bankPoints, atmPoints, markerPoints = {}, {}, {}

                if (IsPedOnFoot(data.ped) and not ESX.PlayerData.dead) and not inMenu then
                    for i = 1, #Config.AtmModels do
                        local atm = GetClosestObjectOfType(data.coord.x, data.coord.y, data.coord.z, 0.7, Config.AtmModels[i], false, false, false)
                        if atm ~= 0 then
                            atmPoints[#atmPoints+1] = GetEntityCoords(atm)
                        end
                    end

                    for i = 1, #Config.Banks do
                        local bankDistance = #(data.coord - Config.Banks[i].Position.xyz)
                        if bankDistance <= 0.7 then
                            bankPoints[#bankPoints+1] = Config.Banks[i].Position.xyz
                        end
                        if Config.ShowMarker and bankDistance <= (Config.DrawMarker or 10) then
                            markerPoints[#markerPoints+1] = Config.Banks[i].Position.xyz
                        end
                    end
                end

                if next(bankPoints) and not uiActive then
                    self:TextUi(true)
                end

                if next(atmPoints) and not uiActive then
                    self:TextUi(true, true)
                end

                if not next(bankPoints) and not next(atmPoints) and uiActive then
                    self:TextUi(false)
                end

                Wait(1000)
            end
        end)

Replace:

CreateThread(function ()
            while playerLoaded do
                data.coord = GetEntityCoords(data.ped)
                data.ped = PlayerPedId()
                bankPoints, markerPoints = {}, {}

                if (IsPedOnFoot(data.ped) and not ESX.PlayerData.dead) and not inMenu then
                    for i = 1, #Config.Banks do
                        local bankDistance = #(data.coord - Config.Banks[i].Position.xyz)
                        if bankDistance <= 0.7 then
                            bankPoints[#bankPoints+1] = Config.Banks[i].Position.xyz
                        end
                        if Config.ShowMarker and bankDistance <= (Config.DrawMarker or 10) then
                            markerPoints[#markerPoints+1] = Config.Banks[i].Position.xyz
                        end
                    end
                end

                if next(bankPoints) and not uiActive then
                    self:TextUi(true)
                end

                if not next(bankPoints) and uiActive then
                    self:TextUi(false)
                end

                Wait(1000)
            end
        end)

okokBanking (not tested yet):

  • Remove NearATM() function. (client.lua)

  • Remove the whole Citizen.CreateThread where used NearATM() function.

Last updated