From 352f480e8c8ae27438db71d7a6a877d37cb603cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20F=C3=BClling?= Date: Sat, 14 Dec 2019 20:28:37 +0100 Subject: [PATCH] [#12] try to make it faster --- client/functions.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index 607334d..1b7a5fa 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -37,12 +37,14 @@ function __drawPcMarkers(location) if location.x ~= NIL then -- some locations are not machines if location.machine ~= NIL then - drawGenericMarker(location.x, location.y, location.z - 1.001) - if GetDistanceBetweenCoords(location.x, location.y, location.z, GetEntityCoords(GetPlayerPed(-1), true)) < 2 then - if IsControlJustPressed(1, 38) then - EnableGui(true, location.machine) - else - ESX.ShowHelpNotification(missionMarker.hint) + if GetDistanceBetweenCoords(location.x, location.y, location.z, GetEntityCoords(GetPlayerPed(-1), true)) < 200 then + drawGenericMarker(location.x, location.y, location.z - 1.001) + if GetDistanceBetweenCoords(location.x, location.y, location.z, GetEntityCoords(GetPlayerPed(-1), true)) < 2 then + if IsControlJustPressed(1, 38) then + EnableGui(true, location.machine) + else + ESX.ShowHelpNotification(missionMarker.hint) + end end end end