đźš— [RELEASE] Autopilot

autopilot_hd

attention_ ATTENTION: COMPATIBILITY

This script uses QBCore notifications.
To make this script standalone, remove all the QBCore.Functions.Notify in client/main.lua.

This script uses interact-sound.
To use the provided sounds, ensure to have that resource, and follow the interact-sound guide on how to add sounds.

Features

Vehicle Models
Only allow certain vehicle models to use autopilot.
Configure the table in config.lua.

Keymapping
Adds the ability for your community to change their keybinds to their desires.
Default: N to engage/disengage autopilot.
Default: UPARROW to increase/decrease speed.

Vehicle Body Health
Option to turn on/off.
Disengage autopilot if the vehicles body health is less than the configured percentage during the drive.

Different Autopilot Speeds
Three different speeds during autopilot. Configured through config.lua.

Smooth Braking
Slows down the vehicle at a reasonable phase when reaching your destination.

Optimization
0.00ms - Majority of the time.
0.01ms - During braking sequence & keymapping.

Showchase & Download

Video Showcase
Download/Github

Suggestions or ideas? Let me know in the comments!

11 Likes

thats a really nice release and for free +1 what about adding options like law driving that stops on red lights and rush mode ?

3 Likes

Thank you @ftz-resources!

It’s currently following traffic laws.

You can change the driving style by modifying the values of the native TaskVehicleDriveToCoord.
Do a search within the script to find the native, there are 4 of them in the script.

A good guide for driving styles can be found here.

thank you so much i hope you have a nice day/night :wink: )

1 Like

Good job and free, which is hard to see lately.

2 Likes

the sound isn’t working and i cant use addon cars for some weird reason otherwise great resource well done.

1 Like

Make sure to read the guides provided by interact-sound. There’s some information in my initial post regarding it.

Addon cars have been tested and they do work. Make sure to put the correct model/spawn name into the config.

Will do cheers

Hey man, i love that script but one big problem still left… i cannot add addon vehicles to the list. They just dont work… only gta standard vehicles work.

“CYCLONE”, “ASEA”, “PBUS” and so on… just vanilla cars works fine.

any fix?

Hello. I just tried with an addon car and it worked as intended. How are you adding the cars to the config?

in qbcore the vehicles are in the qb-core/shared.lua

when the vehicle is not in the shared.lua, it doesnt spawn. can it be something with that?

They should spawn even if the vehicles aren’t in the shared file.

Make sure that you can get your cars to spawn. When they do, put the spawn name in the autopilot config and try again.

I tried with three different addon cars and it worked without any issues.

they spawn without any problem since 4 months.

Do the names have to be in all caps?

I am having a similar issue as mentioned above. Running qbcore but addon cars (like the tesla or urus) do not register the autopilot events. I have added them to config in lowercase and allcaps but nothing seems to work unless it is a default GTA car.

I sadly don’t know how to help with this issue.
I cannot recreate the issue in my own environment, so I’m not fully sure how to solve it.

We are still testing but have not found an addon that is working yet. Are you using any addon//import vehicles in your environment? If so, which spawn names are working?

Yes. Every car I’ve tried has worked. I just recently downloaded and tested with the linked one below. That worked as well. If you are using dashses or similar symbols on your vehicle spawn-name then that may be a reason why.

2015 Ferrari LaFerrari [Add-On | Livery] - GTA5-Mods.com

You sir must have something different in your files for the car. Can you please share a capture of your config file?

To everyone having an issue with certain addon cars not working with this script I have found the solution. The problem lies within the car files. If you go into the vehicles meta file, check the game Name. If that doesn’t match the spawn name you are putting in the script the that is why it is not working. Simply change the name to match and you are good to go. If you have a lot of addon cars like this you will have to do it to all of them unfortunately but your cars should perform better with scripts that way.
image_2022-07-05_024220556

3 Likes