function getClosestVehInCamera()
local x, y, z = getCharCoordinates(PLAYER_PED)
local pX, pY, pZ = SearchMarker(x, y, z, 100.0, false)
local minDist = 999
local veh
for k, v in ipairs(getAllVehicles()) do
local cX, cY, cZ = getCarCoordinates(v)
if isPointOnScreen(cX, cY, cZ, minDist) then
if minDist => getDistanceBetweenCoords3d(pX, pY, pZ, cX, cY, cZ) then
minDist = getDistanceBetweenCoords3d(pX, pY, pZ, cX, cY, cZ)
veh = v
end
end
end
return veh, minDist
end