fix getNearbyPlayers

This commit is contained in:
Mycroft
2022-08-11 18:19:08 +01:00
parent 4e0d8e9a2c
commit 9a2e42c1f8
+2 -2
View File
@@ -25,13 +25,13 @@ local function getNearbyPlayers(source, closest, distance, ignore)
local coords = GetEntityCoords(entity)
if not closest then
local dist = #(xPlayer.source - coords)
local dist = #(source - coords)
if dist <= distance then
count += 1
result[count] = {id = xPlayer.source, ped = NetworkGetNetworkIdFromEntity(entity), coords = coords, dist = dist}
end
else
local dist = #(xPlayer.source - coords)
local dist = #(source - coords)
if dist <= (result.dist or distance) then
result = {id = xPlayer.source, ped = NetworkGetNetworkIdFromEntity(entity), coords = coords, dist = dist}
end