Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions imports/getClosestPlayer/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ function lib.getClosestPlayer(coords, maxDistance, includePlayer)
local playerCoords = GetEntityCoords(playerPed)
local distance = #(coords - playerCoords)

if GetVehiclePedIsIn(playerPed,false) ~= 0 then
Comment thread
tugamars marked this conversation as resolved.
Outdated
playerCoords=GetWorldPositionOfEntityBone(playerPed,0)
end

if distance < maxDistance then
maxDistance = distance
closestId = playerId
Expand Down