- Documentation
- Server events
- onPedDrivePointReached
Event
onPedDrivePointReached
The NPC driver reached a route point set by setPedDriveRoute (within stopRadius).
Handler
addEventHandler("onPedDrivePointReached", root, function(vehicle, index) ... end)Parameters
vehiclevehicle- The vehicle.
indexint- The point index.
Source
source is the NPC.
Example
addEventHandler("onPedDrivePointReached", driver, function(vehicle, index)
setVehicleDoorOpenRatio(vehicle, 2, 1, 500)
end)
See also
setPedDriveRouteThe NPC driver follows a list of points along the game's roads. The game's autopilot drives: it turns at junctions, avoids cars and waits at red lights.onPedDrivePointReachedfires after each point andonPedDriveFinishedafter the last one. If the driver's seat is free, the NPC is put into it.onPedDriveFinishedThe NPC driver reached the last route point (withoutloop) or the target ofsetPedDriveTo.