ClosestVehicle

Get the nearest vehicle to the given player/ped

Parameters description

Parameter
Type
Description
Default

Id

integer?

player server Id or ped or nil

current player

returnCloseVehs

boolean?

choose to receive the all the close vehicles

false

Example

local closestVehicle = HRLib.ClosestVehicle(PlayerPedId())
print('The closest vehicle to you:\n'...json.encode(closestVehicle, { indent = true }))

Last updated