Skip to content

Commit

Permalink
Update main.lua
Browse files Browse the repository at this point in the history
Fixed marker system
  • Loading branch information
Mohamslw authored Aug 15, 2023
1 parent f6b19b8 commit 70591a6
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,24 @@ function UpdateMods(data)
end
end

CreateThread(function()
while true do
local coords, waitingtime, waitingbool = GetEntityCoords(PlayerPedId()), 500, true

for k, v in pairs(Config.Zones) do
local distance = #(coords - vector3(v.Pos.x, v.Pos.y, v.Pos.z))

if v.Marker ~= -1 and distance < 10 then
waitingtime = 0
DrawMarker(v.Marker, v.Pos.x, v.Pos.y, v.Pos.z - 0.8, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 2.0, 2.0, 1.0, 100, 100, 100, 100, false, true, 2, true, nil, nil, false)
waitingbool = false
end
end

Wait(waitingtime)
end
end)

function GetAction(data)
local elements = {}
local menuName = ''
Expand Down Expand Up @@ -502,8 +520,6 @@ CreateThread(function()
SetBlipScale(blip, 0.8)
SetBlipAsShortRange(blip, true)

DrawMarker(v.Marker, v.Pos.x, v.Pos.y, v.Pos.z)

BeginTextCommandSetBlipName('STRING')
AddTextComponentSubstringPlayerName(v.Name)
EndTextCommandSetBlipName(blip)
Expand Down

0 comments on commit 70591a6

Please sign in to comment.