Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to make a ped fly a helicopter?

Featured Replies

Hi again,

I have a question which is how I get a ped to fly a helicopter properly? (to a certain x,y,z location)

I've tried the following sofar:

 

NativeFunction.CallByName("TASK_HELI_MISSION")

Pilot.Tasks.DriveToPosition

 

-TASK_HELI_MISSION makes the ped to up about 50f and then spin around in circles.

-DriveToPosition(Yes I know is normally for land vehicle) but I've seen someone saying it works...anyhow the pilot again goes up about 50f then goes somewhere to LSIA and from then on just keeps on flying across the see.

 

What I want my pilot to do:

Wait till I get in(got that sorted) then drive to a coord, when he is near to that coord(as TASK_HELI_MISSION says) he should land in a certain radius from the Destination.

There are different flags for the heli mission task. You need to figure out the right flag and pass the right values for that flag. There's some documentation on the NativeDB about how to use the native and what flags do what. 

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

AI::TASK_HELI_MISSION

Hashes: 0xDAD029E187A2BEB4 0x0C143E97
void TASK_HELI_MISSION(Ped pilot, Vehicle aircraft, Vehicle targetVehicle,
  Ped targetPed, float destinationX, float destinationY,
  float destinationZ, int missionFlag, float maxSpeed,
  float landingRadius, float targetHeading, int unk1, int unk2,
  Hash unk3, int landingFlags) // 0xDAD029E187A2BEB4 0x0C143E97
EDITED (8/16/2017)

DESCRIPTION:
Allow a ped to fly to a specific destination.

USAGE:
-- REQUIRED --
• pilot = The ped flying the aircraft.
• aircraft = The aircraft the pilot is flying.

-- OPTIONAL -- [atleast 1 must be assigned]
• targetVehicle = The vehicle the pilot will target.
• targetPed = The ped the pilot will target.
• destinationX, destinationY, destinationZ = The location the pilot will target.

-- LOGIC --
• missionFlag = The type of mission.
• maxSpeed = The speed in mph that the pilot will limit his/her self to while flying.
• landingRadius = The distance from the destination that the pilot must be to land.
• targetHeading = The heading that the pilot will try to achieve while flying.
• unk1, unk2 = Set to -1 and it will be okay.
• unk3 = I'm almost sure this is a vehicle record/waypoint recording hash. A value of -1 is for none. Maybe it's a float? Idk.
• landingFlags = Bit flags used for landing. All I know is:
0 = Hover over the destination.
32 = Land on destination.
1024 = Erratic, crash into nearby obstacles.
4096 = Rushed movement + Hover over destination

Known Mission Types:
4 = FlyToCoord
8 = FleeFromPed
9 = CircleAroundTarget
10 = CopyTargetHeading
20 = LandNearPed
21 = Crash

Example C#:
Function.Call(Hash.TASK_HELI_MISSION, driver, heli, 0, 0, position.X, position.Y, position.Z, 4, 50.0, 10.0, (position - heli.Position).ToHeading(), -1, -1, -1, 32);


Copied from http://www.dev-c.com/nativedb/ ^^  Just what PNWParksFan mentioned!

k, the :

(position - heli.Position).ToHeading()

is that something you have to do if your are "using GTA"

or is that usable in the rph reference?

13 hours ago, NoNameSet said:

k, the :


(position - heli.Position).ToHeading()

is that something you have to do if your are "using GTA"

or is that usable in the rph reference?

 

RPH doesn't have an equivalent but since SHVDN is open source, you can create a Vector3 extension.

public static float ToHeading(this Vector3 v)
{
	return (float)((Math.Atan2(v.X, -v.Y) + Math.PI) * (180 / Math.PI));
}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.