Skip to content

Commit

Permalink
Update functions.lua (#332)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew <22198949+MafewTM@users.noreply.github.com>
Co-authored-by: David Malchin <malchin459@gmail.com>
  • Loading branch information
3 people committed Jan 26, 2024
1 parent bc24b2a commit 2cbc186
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bridge/qb/client/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,15 @@ end

---@deprecated use lib.getClosestVehicle from ox_lib
functions.GetClosestVehicle = function(coords)
coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords or GetEntityCoords(cache.ped)
local closestVehicle, vehicleCoords = lib.getClosestVehicle(coords)
local vehicleDistance = #(coords - vehicleCoords)
return closestVehicle, vehicleDistance
end

---@deprecated use lib.getClosestObject from ox_lib
functions.GetClosestObject = function(coords)
coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords or GetEntityCoords(cache.ped)
local closestObject, objectCoords = lib.getClosestObject(coords)
local objectDistance = #(coords - objectCoords)
return closestObject, objectDistance
Expand Down

0 comments on commit 2cbc186

Please sign in to comment.