mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-02 11:18:53 +00:00
Tweak: ESX Drugs - Optimisations
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user