[FREE][Release][QBCore] AI Taxi Script - Navigate to Waypoint

Hello All, this is my first release here I hope you enjoy it!

This is an AI waypoint based taxi service, allowing players to use the /taxi command to call a taxi that will transport them to the desired location using their map marker. Players will be charged a fee based on the distance of the route which is configurable in the source/shared/shared.ts file along with several other configurable options.

QB-Target is no longer required but is recommended, using the default vehicle entry key for controller and keyboard will trigger the player to enter the back of the taxi.

You can download it here GitHub - Z3R0L0G1C/zc-aitaxi: An AI Taxi Script for Fivem

Preview Video : https://www.youtube.com/watch?v=tbfPFR10-1o

Edit: GitHub now has TS source as well, added an idle timer after spawning the taxi, added option if using cash as item to show QB-Inventory item boxes.

Enjoy!

Code is accessible Yes
Subscription-based No
Lines (approximately) 400
Requirements QB-Core, QB-Target
Support Maybe
4 Likes

It is recommended, since it is a public release, that you also give the open source and compiled code.

1 Like

+1 I agree…

Bro uploaded minimized JS to github :skull:

My bad everyone repo will be updated with the source shortly didn’t realize I had it on the gitignore.

1 Like

It happens. At least you didn’t upload some nsfw stuff on accident.

2 Likes

Repo updated with the source

1 Like

im having issues that when i go to get into the cab i can only get in the front seat and the driver gets out and wants to fight

This script utilizes qb-target for entering the vehicle, you’ll have to use QB-target to enter for it to function properly.

If you download the latest version on GitHub I have removed the need for qb-target and made it possible to enter the taxi using the “f” key or “y” button.

would be nice if ESX

ok cool thank you

1 Like

When I call a taxi and then I want to call another taxi it doesn’t let me, does anyone know how to solve it?

Seems to be a bug I’ve introduced in a recent push. Will investigate this when I’m back at the computer, and let you know to pull the repo again. Should have a fix for this tonight.

Please download the latest version from GitHub, I have also added an NUI meter to the script.

1 Like

Ok, I will download it now, thank you very much bro.

1 Like

how do i adjust the fuel to the fuel script i use? keeps showing No Fuel error when the cab is driving

Sorry for the long delay, I have been doing other projects.

You’ll need to figure out what the export or event is that your fuel script uses for setting fuel for vehicles, then call it after the vehicle is spawned on the client side.

go into zc-aitaxi/source/client/client.ts

Approx. line #: 139

if(thisTaxi == null) {
thisTaxi = CreateVehicle(Config[0][“TaxiCabHash”], vehicleSpawn[0], vehicleSpawn[1], vehicleSpawn[2], vehicleHeading, true, true);
//Exports[‘your_fuel_script’].setFuel(thisTaxi, 100); or you could put an event emitNet(“fuel_script_event:server:setFuel”, thisTaxi, 100);
} else {DebugLog("There is already a taxi Entity ID: " + thisTaxi);}

hello i have a problem that when i want to access the cab it does not open the doors and i can not find where to modify the values to let me get into the vehicle. if someone can help me i would appreciate it.

The event is initially triggered if the player is within entry range of the taxi and presses the “Y” button on a game pad or the vehicle entry control key.

That function is defined at approx. line # 60 in source/client/client.ts and the event is being triggered at approx. line # 70.

The function gets called and starts checking for proximity between the player and cab coordinates once the player and cab are close enough if the player presses the vehicle entry key or button then the player is placed in the rear of the vehicle.

The event that it is calling is being defined at approx. line # 182 in source/client/client.ts

Also, make sure that you have the taxi cab defined as an unlocked vehicle in the qb-vehiclekeys resource.

1 Like