Skip to content

← Previous | Next →


driveToCoords

Description

Makes the NPC drive a vehicle to the specified coordinates.

Basic information

Name Type Possibilities
driveToCoords behaviour 2

Parameters

# Name Type Mandatory Description Multiple
1 vehicle Vehicle Yes The vehicle the NPC will drive. No
2 x number Yes The X coordinate to drive to. No
3 y number Yes The Y coordinate to drive to. No
4 z number Yes The Z coordinate to drive to. No
5 distance number No The stopping distance from the coordinates. Defaults to 10.0 if not specified. No
6 speed number No The speed at which the NPC should drive. Defaults to 26.0 if not specified. No
7 mode number No The driving mode to use. Defaults to 786468 if not specified. https://vespura.com/fivem/drivingstyle/ No

Outputs

# Description
1 The NPC is already within the specified distance from the coordinates.
2 The NPC driving to the specified coordinates.

Example


  NPC 

  name Driver 
  model s_m_y_cop_01 
  position -1020.72 4839.78 258.30 0.0 

  interaction 
    nothing 

  behaviour 
    getClosestVehicle vehicle 
      driveToCoords $vehicle 150.0 200.0 300.0