From 72aa0930869ef458c03fb86f81ea151563168066 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Wed, 2 Mar 2022 19:52:58 +0000 Subject: [PATCH] Refactor: ESX Skin - Optimisations --- [esx]/esx_skin/client/main.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/[esx]/esx_skin/client/main.lua b/[esx]/esx_skin/client/main.lua index fbb5c4b7..f8204516 100644 --- a/[esx]/esx_skin/client/main.lua +++ b/[esx]/esx_skin/client/main.lua @@ -143,9 +143,10 @@ end CreateThread(function() while true do - Wait(0) + local sleep = 1500 if isCameraActive then + sleep = 0 DisableControlAction(2, 30, true) DisableControlAction(2, 31, true) DisableControlAction(2, 32, true) @@ -191,9 +192,8 @@ CreateThread(function() PointCamAtCoord(cam, posToLook.x, posToLook.y, coords.z + camOffset) ESX.ShowHelpNotification(_U('use_rotate_view')) - else - Wait(700) end + Wait(sleep) end end) @@ -201,9 +201,10 @@ CreateThread(function() local angle = 90 while true do - Wait(0) + local sleep = 1500 if isCameraActive then + sleep = 0 if IsControlPressed(0, 108) then angle = angle - 1 elseif IsControlPressed(0, 109) then @@ -217,9 +218,8 @@ CreateThread(function() end heading = angle + 0.0 - else - Wait(500) end + Wait(sleep) end end)