Skip to content

Commit 70b7ba8

Browse files
authored
feat: include entity coords if entity is defined (#203)
* feat: include coords in entity data * chore: move logic * fix: lint issues
1 parent 6e8a356 commit 70b7ba8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Diff for: client.lua

+6-3
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ local function EnableTarget()
390390
if data and next(data) then CheckEntity(flag, data, entity, distance) end
391391
end
392392
else
393-
sleep += 20
393+
sleep = sleep + 20
394394
end
395395
if not success then
396396
-- Zone targets
@@ -436,14 +436,14 @@ local function EnableTarget()
436436
DrawOutlineEntity(entity, false)
437437
end
438438
else
439-
sleep += 20
439+
sleep = sleep + 20
440440
end
441441
else
442442
LeftTarget()
443443
DrawOutlineEntity(entity, false)
444444
end
445445
else
446-
sleep += 20
446+
sleep = sleep + 20
447447
end
448448
Wait(sleep)
449449
end
@@ -1192,6 +1192,9 @@ RegisterNUICallback('selectTarget', function(option, cb)
11921192
table_wipe(sendData)
11931193
CreateThread(function()
11941194
Wait(0)
1195+
if data.entity ~= nil then
1196+
data.coords = GetEntityCoords(data.entity)
1197+
end
11951198
if data.action then
11961199
data.action(data.entity)
11971200
elseif data.event then

Diff for: init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ CreateThread(function()
122122
if state ~= 'missing' then
123123
local timeout = 0
124124
while state ~= 'started' and timeout <= 100 do
125-
timeout += 1
125+
timeout = timeout + 1
126126
state = GetResourceState('qb-core')
127127
Wait(0)
128128
end

0 commit comments

Comments
 (0)