Skip to content

ESX.Game.GetVehicleInDirection.md

ESX.Game.GetVehicleInDirection()

This function gets the closest vehicle in the players' direction within 5 units, utilizes ray-casts.

ESX.Game.GetVehicleInDirection Example

local vehicle = ESX.Game.GetVehicleInDirection()

if DoesEntityExist(vehicle) then
  ESX.ShowNotification('yep there is a vehicle here!')
end