- Documentation
- Server events
- onPedDriveFinished
Event
onPedDriveFinished
The NPC driver reached the last route point (without loop) or the target of setPedDriveTo.
Handler
addEventHandler("onPedDriveFinished", root, function(vehicle) ... end)Parameters
vehiclevehicle- The vehicle.
Source
source is the NPC.
Example
addEventHandler("onPedDriveFinished", driver, function(vehicle)
setPedDriveTo(source, vehicle, 1750, -1890, 13.5)
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.setPedDriveToThe NPC driver drives to a single point along the game's roads.onPedDriveFinishedfires on arrival.