[JS] Get Vehicles Within Range

Started by Vortrex, July 06, 2019, 11:56:44 PM

Previous topic - Next topic

Vortrex

Works both client and server-side.
function getVehiclesInRangeOfPos(pos, distance) {
    return getVehicles().filter(x => x.position.distance(pos) <= range);
}