Tweaks - Identity & ATM - Optimisations

This commit is contained in:
Mycroft
2022-03-02 20:07:01 +00:00
parent 1304488ccf
commit 536bf2586e
2 changed files with 10 additions and 16 deletions
+3 -3
View File
@@ -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
+7 -13
View File
@@ -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)