local atms = {
"prop_atm_01",
"prop_atm_02",
"prop_atm_03",
"prop_fleeca_atm",
}
alreadyOnATM = false
function exitATM ()
RequestAnimDict("amb@prop_human_atm@male@enter")
while (not HasAnimDictLoaded("amb@prop_human_atm@male@enter")) do
Citizen.Wait(1)
end
TaskPlayAnim(PlayerPedId(),"amb@prop_human_atm@male@enter", "enter", 1.0, 1.0, 3000, 0, 1, true, true, true)
Citizen.Wait(3000)
RequestAnimDict("amb@prop_human_atm@male@idle_a")
while (not HasAnimDictLoaded("amb@prop_human_atm@male@idle_a")) do
Citizen.Wait(1)
end
TaskPlayAnim(PlayerPedId(),"amb@prop_human_atm@male@idle_a", "idle_c", 1.0, -1.0, -1, 0, 1, true, true, true)
ClearPedTasks(GetPlayerPed(-1))
Citizen.Wait(6500)
alreadyOnATM = false
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(8)
for i = 1, #atms do
local nearestatm = GetClosestObjectOfType(GetEntityCoords(GetPlayerPed(-1), true), 1.75, GetHashKey(atms[i]), false)
if DoesEntityExist(nearestatm) then
if not alreadyOnATM then
SetTextFont(0)
SetTextProportional(1)
SetTextScale(0.0, 0.3)
SetTextColour(0, 255, 0, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString("ATM'ye erişmek için E'ye basın.")
DrawText(0.01, 0.02)
end
if IsControlJustPressed(0, 38) then
if alreadyOnATM then
ExecuteCommand("atm")
exitATM()
else
print(GetEntityForwardVector(nearestatm), GetEntityRotation(nearestatm))
SetEntityHeading(GetPlayerPed(-1), GetEntityCoords(nearestatm))
RequestAnimDict("amb@prop_human_atm@male@enter")
while (not HasAnimDictLoaded("amb@prop_human_atm@male@enter")) do
Citizen.Wait(1)
end
TaskPlayAnim(PlayerPedId(),"amb@prop_human_atm@male@enter", "enter", 1.0, 1.0, 3000, 0, 1, true, true, true)
Citizen.Wait(3000)
RequestAnimDict("amb@prop_human_atm@male@base")
while (not HasAnimDictLoaded("amb@prop_human_atm@male@base")) do
Citizen.Wait(1)
end
TaskPlayAnim(PlayerPedId(),"amb@prop_human_atm@male@base", "base", 1.0, -1.0, -1, 2, 1, true, true, true)
alreadyOnATM = true
end
end
end
end
end
end)