TaskHeliMission
DocsTaskHeliMission(ped, heli, vehicleTarget, pedTarget, x, y, z, missionType, speed, radius, heading, height, minHeight, slowDist, missionFlags)Description
All parameters except ped, heli and speed are optional, with pedTarget, vehicleTarget, x, y, z being dependent on missionType (ie. Attack/Flee mission types require a target ped/vehicle, whereas GoTo mission types require either x, y, z or a target ped/vehicle).
If you don't want to use a parameter; pass 0.0f for x, y and z, 0 for pedTarget, vehicleTarget, 0 for other int parameters, and -1.0f for the remaining float parameters.
enum eHeliMissionFlags
{
None = 0,
AttainRequestedOrientation = 1,
DontModifyOrientation = 2,
DontModifyPitch = 4,
DontModifyThrottle = 8,
DontModifyRoll = 16,
LandOnArrival = 32,
DontDoAvoidance = 64,
StartEngineImmediately = 128,
ForceHeightMapAvoidance = 256,
DontClampProbesToDestination = 512,
EnableTimeslicingWhenPossible = 1024,
CircleOppositeDirection = 2048,
MaintainHeightAboveTerrain = 4096,
IgnoreHiddenEntitiesDuringLand = 8192,
DisableAllHeightMapAvoidance = 16384,
// ForceHeightMapAvoidance | DontDoAvoidance
HeightMapOnlyAvoidance = 320,
}Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | The ped to be tasked. |
heli | Vehicle | The helicopters' entity handle. |
vehicleTarget | Vehicle | The target vehicle (default is 0). |
pedTarget | Ped | The target ped (default is 0). |
x | float | The x coordinate of the target (default is 0.0f). |
y | float | The y coordinate of the target (default is 0.0f). |
z | float | The z coordinate of the target (default is 0.0f). |
missionType | int | The mission type (default is 0) (see [TaskVehicleMission](#\_0x659427E0EF36BCDE)). |
speed | float | The speed in m/s. |
radius | float | The radius of when the task will be completed (default is -1.0f). |
heading | float | The heading the helicopter will face at task completion (default is -1.0f). |
height | float | The height the helicopter will fly at (default is -1.0f). |
minHeight | float | The height the helicopter will not fly below (default is -1.0f). |
slowDist | float | The distance to the target at which the helicopter will slow down (default is -1.0f). |
missionFlags | int | The mission flags (default is 0) (see `eHeliMissionFlags`). |
Quick Snippet: Get Coordinatesxyzheading
xyzheadingAdd this command to your client script to retrieve precise locations in-game.
-- Add this to your client.lua. Type /pos in-game to copy coords.
RegisterCommand('pos', function()
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
local output = string.format("vector4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading)
print(output)
TriggerEvent('chat:addMessage', { args = { '^4[COORD]^0', output } })
end)Quick Snippet: Get Ped HandlepedpedTarget
pedpedTargetUse this to get the player ped handle for this native.
-- Get the player's ped handle (client-side)
local ped = PlayerPedId()
print("Ped handle: " .. ped)
-- For a specific player's ped (server-side):
-- local targetPed = GetPlayerPed(source)Quick Snippet: Get VehiclehelivehicleTarget
helivehicleTargetUse this to get the current vehicle handle for this native.
-- Get the vehicle the player is currently in
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsIn(ped, false)
if vehicle ~= 0 then
print("Vehicle handle: " .. vehicle)
print("Model: " .. GetEntityModel(vehicle))
else
print("Player is not in a vehicle")
endVehicle Models

adder
alpha
blade
ardent
asea
cogcabrio
baller
blistaPed Models

mp_m_freemode_01
player_zero
ig_agatha
s_m_y_cop_01
s_m_m_gaffer_01
g_m_m_armboss_01
a_c_boar
a_m_m_bevhills_01Returns
voidThis native does not return a value.
Examples
Official
local heli_model = `akula`
RequestModel(heli_model)
repeat Wait(0) until HasModelLoaded(heli_model)
-- Player needs to be outside for this to work
local ped = PlayerPedId()
local coords = GetEntityCoords(ped) + GetEntityForwardVector(ped) * 100.0
local heli = CreateVehicle(heli_model, coords.x, coords.y, coords.z + 50.0, GetEntityHeading(ped) - 180.0, true, false)
-- Allow the game engine to clear the model from memory
SetModelAsNoLongerNeeded(heli_model)
SetHeliBladesFullSpeed(heli)
local ped_model = `a_m_m_skater_01`
RequestModel(ped_model)
repeat Wait(0) until HasModelLoaded(ped_model)
local pilot = CreatePedInsideVehicle(heli, 0, ped_model, -1, true, false)
-- Allow the game engine to clear the model from memory
SetModelAsNoLongerNeeded(ped_model)
TaskHeliMission(pilot, heli, 0, 0, coords.x, coords.y, coords.z, 19, 10.0, -1.0, -1.0, -1.0, -1.0, -1.0, 96)
-- Mission Type: Land | Mission Flags: LandOnArrival | DontDoAvoidance
SetPedKeepTask(pilot, true)