setPedDriveMission
Tell an NPC driver to escort another vehicle from its left side using GTA's original mission-driving AI.
Syntax
bool setPedDriveMission(ped thePed, vehicle theVehicle, vehicle targetVehicle, string|int mission, float speed [, string|int drivingStyle = "stop_for_cars"])GTA task mapping
CTaskComplexCarDriveMissionSCM equivalent: MISSION_ESCORT_LEFT
San Andreas Online currently admits only GTA mission ID 29, the escort-left behavior verified by the Sweet & Kendl checkpoint.
Arguments
thePedpedLiving streamed ped simulated by this client.
theVehiclevehicleStreamed, non-blown vehicle occupied and controlled by the ped.
targetVehiclevehicleDifferent streamed, non-blown vehicle to escort.
missionstring|intescort_left or its native ID 29.
speedfloatFinite cruise speed from 0 up to, but not including, 255.
drivingStylestring|intoptional · default stop_for_carsInteger 0..6 or a documented driving-style name.
Returns
true when GTA accepted the escort task; false when ownership, vehicles, seat, mission, speed, style, or native task construction is invalid.
Ownership and lifecycle
Low-level ped task calls require the client that simulates the living, streamed ped. Driving tasks also require control of the streamed vehicle. They do not create lifecycle handles; the optional native-task-runtime adds server-owned route epochs and reconstruction for drive_to routes. Gang-tag ownership is resource-exclusive, survives object streaming and recreation, and is released automatically when the owner stops.
- escort_left is the only mission mode currently admitted. true means the task was accepted, not that the escort is complete.
Example
-- client.lualocal escortCar = createVehicle(412, 2490, -1685, 13.4)local targetCar = createVehicle(492, 2500, -1685, 13.4)local driver = createPed(105, 2490, -1685, 13.4)
warpPedIntoVehicle(driver, escortCar, 0)assert(setPedDriveMission(driver, escortCar, targetCar, "escort_left", 18, "avoid_cars"))Where this comes from
Continue exploring
← Back to the SA:O Lua API · How Native ped tasks and gang tags works →