diff --git a/[esx_addons]/esx_drugs/client/main.lua b/[esx_addons]/esx_drugs/client/main.lua index 04304c16..bfc5cd2f 100644 --- a/[esx_addons]/esx_drugs/client/main.lua +++ b/[esx_addons]/esx_drugs/client/main.lua @@ -32,7 +32,9 @@ end) --drawk marker CreateThread(function() while true do + local Sleep = 1500 if(inRangeMarkerDrugShop) then + Sleep = 0 local coordsMarker = Config.CircleZones.DrugDealer.coords local color = cfgMarker.Color DrawMarker(cfgMarker.Type, coordsMarker.x, coordsMarker.y,coordsMarker.z - 1.0, @@ -40,23 +42,22 @@ CreateThread(function() cfgMarker.Size, color.r,color.g,color.b,color.a, false, true, 2, false, nil, nil, false) end - Wait(0) + Wait(Sleep) end end) --main loop CreateThread(function () while true do - if inZoneDrugShop then - if(not menuOpen) then - ESX.ShowHelpNotification(_U('dealer_prompt'),true) - if IsControlJustPressed(0, 38) then - OpenDrugShop() - end + local Sleep = 1500 + if inZoneDrugShop and not menuOpen then + Sleep = 0 + ESX.ShowHelpNotification(_U('dealer_prompt'),true) + if IsControlJustPressed(0, 38) then + OpenDrugShop() end end - - Wait(15) + Wait(Sleep) end end) diff --git a/[esx_addons]/esx_drugs/client/weed.lua b/[esx_addons]/esx_drugs/client/weed.lua index b31f9685..8becb871 100644 --- a/[esx_addons]/esx_drugs/client/weed.lua +++ b/[esx_addons]/esx_drugs/client/weed.lua @@ -73,7 +73,7 @@ end CreateThread(function() while true do - Wait(0) + local Sleep = 1500 local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) @@ -86,6 +86,7 @@ CreateThread(function() end if nearbyObject and IsPedOnFoot(playerPed) then + Sleep = 0 if not isPickingUp then ESX.ShowHelpNotification(_U('weed_pickupprompt')) end @@ -114,9 +115,8 @@ CreateThread(function() isPickingUp = false end, 'cannabis') end - else - Wait(500) end + Wait(Sleep) end end)