Skip to main content

GetClosestVehicle

ESX.Game.GetClosestVehicle(coords, modelFilter)

This function gets the closest vehicle.

Arguments

ArgumentData TypeOptionalDefault ValueExplanation
coordstableYes(your player ped coords)Coords to search at
modelFiltertable&vector3Yes-Enables whitelist mode for getting closest vehicle. The table must be key-value where the key is the model hash, and value set to true.