Skip to content

TheRealFloatDev/fivem-autopilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FiveM Autopilot [DISCONTINUED]

A simple autopilot Lua class for fiveM planes

Installation

As file in your project

1. Add to your project

Just copy the autopilot.lua to your projects folder

2. Add lua-file to your rescources

Add the following line to your __rescource.lua:
client_scripts {'autopilot.lua',}

3. Call functions

Enable:
autopilot:activateAutopilot(pilot, plane, x, y, z, speed, autospeed, model)

pilot is the Pilots Player Entity, which you can get with GetPlayerPed()

plane is the Planes Entity, which you can get with GetVehiclePedIsIn(GetPlayerPed())

x is the destinations x-coordinate

y is the destinations y-coordinate

z is the altitude

speed is the planes airspeed

autospeed is a boolean value(true/false), which is for enabling or disabling AutomaticThrustControl, which reduces the propability of being too slow

model is the planes model name, which you can get with GetEntityModel(GetVehiclePedIsIn(GetPlayerPed()))

Disable:

autopilot:deactivateAutopilot(pilot)

pilot is the Pilots Player Entity, which you can get with GetPlayerPed()

As external resource

1. Download the latest release

1.Go to the "releases"-tab 2.Download the latest release

2. Install to your server

1. Unzip the downloaded file 2. Copy the folder contained in the .zip-file to your fivem-server's "rescources"-folder 3. Add `start autopilot` to your server.cfg

3. Add to your resource.lua file 1. open your project 2. open your __resource.lua 3. Add the following lines:
client_scripts {
 "@autopilot/autopilot.lua",
 }

Example

Enable:

autopilot:activateAutopilot(GetPlayerPed(), GetVehiclePedIsIn(GetPlayerPed()), 2000, 1573, 2000, 250, true, GetEntityModel(GetVehiclePedIsIn(GetPlayerPed())))

Disable:

autopilot:deactivateAutopilot(GetPlayerPed())

About

A simple autopilot Lua class for fiveM planes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages