TasksClient

taskPlaneMission

TASK_PLANE_MISSION0x23703CD154E83B88

The GTA V native TASK_PLANE_MISSION of the TASK namespace, as LS:MP client scripts call it: the global function taskPlaneMission, in JavaScript and in Lua.

SignatureJavaScript
taskPlaneMission(
  pilot: Ped,
  aircraft: Vehicle,
  targetVehicle: Vehicle,
  targetPed: Ped,
  destinationX: number,
  destinationY: number,
  destinationZ: number,
  missionFlag: number,
  angularDrag: number,
  targetReached: number,
  targetHeading: number,
  maxZ: number,
  minZ: number,
  precise: boolean
): void
SignatureLua
taskPlaneMission(
  pilot: Ped,
  aircraft: Vehicle,
  targetVehicle: Vehicle,
  targetPed: Ped,
  destinationX: number,
  destinationY: number,
  destinationZ: number,
  missionFlag: integer,
  angularDrag: number,
  targetReached: number,
  targetHeading: number,
  maxZ: number,
  minZ: number,
  precise: boolean
)

Usage

JavaScript
taskPlaneMission(
  pilot, aircraft, targetVehicle, targetPed, destinationX, destinationY, destinationZ,
  missionFlag, angularDrag, targetReached, targetHeading, maxZ, minZ, precise
);
Lua
taskPlaneMission(
    pilot, aircraft, targetVehicle, targetPed, destinationX, destinationY, destinationZ,
    missionFlag, angularDrag, targetReached, targetHeading, maxZ, minZ, precise
)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
taskPlaneMission(
  pilot, aircraft, targetVehicle, targetPed, destination, missionFlag, angularDrag,
  targetReached, targetHeading, maxZ, minZ, precise
);
Lua · with vectors
taskPlaneMission(
    pilot, aircraft, targetVehicle, targetPed, destination, missionFlag, angularDrag,
    targetReached, targetHeading, maxZ, minZ, precise
)

Parameters

ParameterTypeJavaScriptLua
pilotPednumberinteger
aircraftVehiclenumberinteger
targetVehicleVehiclenumberinteger
targetPedPednumberinteger
destinationXfloatnumbernumber
destinationYfloatnumbernumber
destinationZfloatnumbernumber
missionFlagintnumberinteger
angularDragfloatnumbernumber
targetReachedfloatnumbernumber
targetHeadingfloatnumbernumber
maxZfloatnumbernumber
minZfloatnumbernumber
preciseBOOLbooleanboolean

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

EXAMPLE USAGE:

Fly around target (Precautiously, keeps high altitude):

Function.Call(Hash.TASK_PLANE_MISSION, pilot, selectedAirplane, 0, 0, Target.X, Target.Y, Target.Z, 4, 100f, 0f, 90f, 0, 200f);

Fly around target (Dangerously, keeps VERY low altitude):

Function.Call(Hash.TASK_PLANE_MISSION, pilot, selectedAirplane, 0, 0, Target.X, Target.Y, Target.Z, 4, 100f, 0f, 90f, 0, -500f);

Fly directly into target:

Function.Call(Hash.TASK_PLANE_MISSION, pilot, selectedAirplane, 0, 0, Target.X, Target.Y, Target.Z, 4, 100f, 0f, 90f, 0, -5000f);

EXPANDED INFORMATION FOR ADVANCED USAGE (custom pilot)

'physicsSpeed': (THIS IS NOT YOUR ORDINARY SPEED PARAMETER: READ!!)
Think of this -first- as a radius value, not a true speed value. The ACTUAL effective speed of the plane will be that of the maximum speed permissible to successfully fly in a -circle- with a radius of 'physicsSpeed'. This also means that the plane must complete a circle before it can begin its "bombing run", its straight line pass towards the target. p9 appears to influence the angle at which a "bombing run" begins, although I can't confirm yet.

VERY IMPORTANT: A "bombing run" will only occur if a plane can successfully determine a possible navigable route (the slower the value of 'physicsSpeed', the more precise the pilot can be due to less influence of physics on flightpath). Otherwise, the pilot will continue to patrol around Destination (be it a dynamic Entity position vector or a fixed world coordinate vector.)

0 = Plane's physics are almost entirely frozen, plane appears to "orbit" around precise destination point
1-299 = Blend of "frozen, small radius" vs. normal vs. "accelerated, hyperfast, large radius"
300+ = Vehicle behaves entirely like a normal gameplay plane.

'patrolBlend' (The lower the value, the more the Destination is treated as a "fly AT" rather than a "fly AROUND point".)

Scenario: Destination is an Entity on ground level, wide open field
-5000 = Pilot kamikazes directly into Entity
-1000 = Pilot flies extremely low -around- Entity, very prone to crashing
-200 = Pilot flies lower than average around Entity.
0 = Pilot flies around Entity, normal altitude
200 = Pilot flies an extra eighty units or so higher than 0 while flying around Destination (this doesn't seem to correlate directly into distance units.)

Reference

Namespace
Tasks TASK
In the game
void TASK_PLANE_MISSION(Ped pilot, Vehicle aircraft, Vehicle targetVehicle, Ped targetPed, float destinationX, float destinationY, float destinationZ, int missionFlag, float angularDrag, float targetReached, float targetHeading, float maxZ, float minZ, BOOL precise)
Hash
0x23703CD154E83B88

Open in the interactive natives reference