mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 05:02:15 +00:00
Tweaks - Identity & ATM - Optimisations
This commit is contained in:
@@ -57,9 +57,10 @@ if not Config.UseDeferrals then
|
||||
|
||||
CreateThread(function()
|
||||
while true do
|
||||
Wait(0)
|
||||
local sleep = 1500
|
||||
|
||||
if guiEnabled then
|
||||
sleep = 0
|
||||
DisableControlAction(0, 1, true) -- LookLeftRight
|
||||
DisableControlAction(0, 2, true) -- LookUpDown
|
||||
DisableControlAction(0, 106, true) -- VehicleMouseControlOverride
|
||||
@@ -79,9 +80,8 @@ if not Config.UseDeferrals then
|
||||
DisableControlAction(0, 143, true) -- disable melee
|
||||
DisableControlAction(0, 75, true) -- disable exit vehicle
|
||||
DisableControlAction(27, 75, true) -- disable exit vehicle
|
||||
else
|
||||
Wait(500)
|
||||
end
|
||||
Wait(sleep)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -45,15 +45,14 @@ end)
|
||||
-- Activate menu when player is inside marker
|
||||
CreateThread(function()
|
||||
while true do
|
||||
Wait(0)
|
||||
local coords = GetEntityCoords(PlayerPedId())
|
||||
local canSleep = true
|
||||
local Sleep = 1500
|
||||
isInATMMarker = false
|
||||
|
||||
for k,v in pairs(Config.ATMLocations) do
|
||||
local Pos = vector3(v.x,v.y,v.z)
|
||||
if #(coords - Pos) < 1.0 then
|
||||
|
||||
if #(coords - Pos) < 2.0 then
|
||||
Sleep = 0
|
||||
isInATMMarker, canSleep = true, false
|
||||
break
|
||||
end
|
||||
@@ -74,20 +73,17 @@ CreateThread(function()
|
||||
hideAll = true
|
||||
})
|
||||
end
|
||||
|
||||
if canSleep then
|
||||
Wait(500)
|
||||
end
|
||||
Wait(Sleep)
|
||||
end
|
||||
end)
|
||||
|
||||
-- Menu interactions
|
||||
CreateThread(function()
|
||||
while true do
|
||||
Wait(0)
|
||||
local Sleep = 1500
|
||||
|
||||
if isInATMMarker and not menuIsShowed then
|
||||
|
||||
Sleep = 0
|
||||
ESX.ShowHelpNotification(_U('press_e_atm'))
|
||||
|
||||
if IsControlJustReleased(0, 38) and IsPedOnFoot(PlayerPedId()) then
|
||||
@@ -104,10 +100,8 @@ CreateThread(function()
|
||||
|
||||
SetNuiFocus(true, true)
|
||||
end
|
||||
|
||||
else
|
||||
Wait(700)
|
||||
end
|
||||
Wait(Sleep)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user