@altv/types-serverNamespacesUtilsBranch: Release CandidateOn this pageUtils Index FunctionsgetClosestPlayergetClosestVehicleFunctions getClosestPlayergetClosestPlayer(options: { pos: IVector3; range?: number }): Player | nullFinds the closest player (if any) from alt.Player.all. pos - From which position to look for the nearest player. range - In which range to search for the nearest vehicle. Defaults to Infinity.getClosestVehiclegetClosestVehicle(options: { pos: IVector3; range?: number }): Vehicle | nullFinds the closest vehicle (if any) from alt.Vehicle.all. pos - From which position to look for the nearest vehicle. range - In which range to search for the nearest vehicle. Defaults to Infinity.
Finds the closest player (if any) from alt.Player.all.
pos
- From which position to look for the nearest player.range
- In which range to search for the nearest vehicle. Defaults toInfinity
.