Skip to main content

Vehicle::getRandomVehicleInSphere

Gets a random vehicle in a sphere at the specified position, of the specified radius.

x: The X-component of the position of the sphere. y: The Y-component of the position of the sphere. z: The Z-component of the position of the sphere. radius: The radius of the sphere. Max is 9999.9004. modelHash: The vehicle model to limit the selection to. Pass 0 for any model. flags: The bitwise flags that modifies the behaviour of this function.

Syntax

```js mp.game.vehicle.getRandomVehicleInSphere(x, y, z, radius, modelHash, flags); ```

Required Arguments

  • x: float
  • y: float
  • z: float
  • radius: float
  • modelHash: Model hash or name
  • flags: int

Return value

  • Vehicle handle or object

Example

```js // todo ```

See also