Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
update variable
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrsyz committed Apr 5, 2022
1 parent cc6ba8a commit 71d5559
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ local function ScreenPositionToCameraRay()
)
end
---------------------------------------
local playerPed
local playerPed, pedCoords
local GetEntityCoords = GetEntityCoords
local Wait = Wait

---@param flag number
---@param playerCoords vector
Expand Down Expand Up @@ -346,19 +348,21 @@ local function EnableTarget()
end
else sleep += 20 end
if not success then
local closestDis, closestZone, pedcoords
if Config.DrawSprite then pedcoords = GetEntityCoords(PlayerPedId()) end
local closestDis, closestZone
if Config.DrawSprite then pedCoords = GetEntityCoords(playerPed) end
for k, zone in pairs(Zones) do
if Config.DrawSprite then
if #(pedcoords - zone.center) < (zone.targetoptions.drawDistance or Config.DrawDistance) and not listSprite[k] then
if not listSprite[k] and #(pedCoords - zone.center) < (zone.targetoptions.drawDistance or Config.DrawDistance) then
listSprite[k] = true
CreateThread(function()
while not HasStreamedTextureDictLoaded("shared") do Wait(10) RequestStreamedTextureDict("shared", true) end
while targetActive do
Wait(0)
SetDrawOrigin(zone.center.x, zone.center.y, zone.center.z, 0)
DrawSprite("shared", "emptydot_32", 0, 0, 0.02, 0.035, 0, 255,255,255, 255.0)
ClearDrawOrigin()
if #(pedCoords - zone.center) < (zone.targetoptions.drawDistance or Config.DrawDistance) then
SetDrawOrigin(zone.center.x, zone.center.y, zone.center.z, 0)
DrawSprite("shared", "emptydot_32", 0, 0, 0.02, 0.035, 0, 255,255,255, 255.0)
ClearDrawOrigin()
end
end
listSprite[k] = false
end)
Expand Down
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Config.Toggle = false

-- Draw sprite on location
Config.DrawSprite = true
Config.DrawDistance = 20.0
Config.DrawDistance = 10.0

-- Enable outlines around the entity you're looking at
Config.EnableOutline = false
Expand Down

0 comments on commit 71d5559

Please sign in to comment.