mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 06:01:27 +00:00
feat(client/functions.lua): Distance
Added second return parameter which contains distance
This commit is contained in:
@@ -155,7 +155,7 @@ function QBCore.Functions.GetClosestVehicle()
|
||||
closestDistance = distance
|
||||
end
|
||||
end
|
||||
return closestVehicle
|
||||
return closestVehicle, closestDistance
|
||||
end
|
||||
|
||||
function QBCore.Functions.GetClosestObject()
|
||||
@@ -172,7 +172,7 @@ function QBCore.Functions.GetClosestObject()
|
||||
closestDistance = distance
|
||||
end
|
||||
end
|
||||
return closestObject
|
||||
return closestObject, closestDistance
|
||||
end
|
||||
|
||||
function QBCore.Functions.GetClosestPed()
|
||||
@@ -190,7 +190,7 @@ function QBCore.Functions.GetClosestPed()
|
||||
closestDistance = distance
|
||||
end
|
||||
end
|
||||
return closestPed
|
||||
return closestPed, closestDistance
|
||||
end
|
||||
|
||||
-- Vehicle
|
||||
|
||||
Reference in New Issue
Block a user