This commit is contained in:
Thekuca
2023-07-26 23:35:25 +02:00
committed by GitHub
parent b6e1c4deba
commit 6bc7d418af
+6 -4
View File
@@ -38,10 +38,12 @@ local function getNearbyPlayers(source, closest, distance, ignore)
result[count] = { id = xPlayer.source, ped = NetworkGetNetworkIdFromEntity(entity), coords = coords, dist = dist }
end
else
local dist = #(playerCoords - coords)
if dist <= (result.dist or distance) then
result = { id = xPlayer.source, ped = NetworkGetNetworkIdFromEntity(entity), coords = coords, dist = dist }
end
if xPlayer.source ~= source then
local dist = #(playerCoords - coords)
if dist <= (result.dist or distance) then
result = { id = xPlayer.source, ped = NetworkGetNetworkIdFromEntity(entity), coords = coords, dist = dist }
end
end
end
end
end