[FREE] MSK AI Taxi

MSK AI Taxi

Simple AI Taxi for ESX and QBCore

Github Download

Description

  • You can call a taxi with a command
  • You can abort the taxi with a command and hotkey
  • You can set multiple Spawnpoints for the taxi
  • You can change the Drivingstyle and Speedzones
  • You can set different pedmodels with name and voice
  • You can set the price
  • The Taxi will change the speed on specified speedzones

Config

Open Config
Config = {}
----------------------------------------------------------------
Config.Locale = 'de'
Config.VersionChecker = true
----------------------------------------------------------------
-- !!! This function is clientside AND serverside !!!
Config.Notification = function(source, message, typ)
    if IsDuplicityVersion() then -- serverside
        exports.msk_core:Notification(source, 'AI Taxi', message, typ)
    else -- clientside
        exports.msk_core:Notification('AI Taxi', message, typ)
    end
end
----------------------------------------------------------------
-- If set to 'Standalone' then you have to add your own functions in server.lua
Config.Framework = 'ESX' -- Set to 'ESX', 'QBCore' or 'Standalone'
----------------------------------------------------------------
-- For ESX you'll need esx_addonaccount for that!
-- For QBCore you'll need qb-banking for that!
Config.Society = {
    enable = false, -- Set false if you don't want that the Price will be added to a society account
    account = 'society_taxi'
}
----------------------------------------------------------------
-- If you deactivate the command, you can still use the export: exports.msk_aitaxi:callTaxi()
Config.Command = {
    enable = true,
    command = 'callTaxi'
}

Config.AbortTaxiDrive = {
    enable = true,
    command = 'abortTaxi',
    hotkey = 'X'
}

Config.SpawnRadius = 200.0 -- default: 200.0 meters // Do not set more than 200.0!
Config.DrivingStyle = 786731 -- default: 786731 // https://vespura.com/fivem/drivingstyle/
Config.SpeedType = 3.6 -- kmh = 3.6 // mph = 2.236936
Config.SpeedZones = {
    -- Speed of the Taxi in specific zones
    [2] = 100, -- City / main roads
    [10] = 60, -- Slow roads
    [64] = 60, -- Off road
    [66] = 150, -- Freeway
    [82] = 150, -- Freeway tunnels
}

Config.Price = {
    base = 20, -- Price for driving to your position
    tick = 0.15, -- Price per tick
    tickTime = 50, 

    color = {r = 255, g = 255, b = 255, a = 255},
    position = {height = 0.90, width = 0.50}
}

Config.Jobs = {
    enable = true, -- Set false to deactivate this feature
    amount = 0, -- Maximum players online in this jobs to call a taxi
    jobs = {
        'taxi',
        'taxi2',
    }
}
----------------------------------------------------------------
-- It will use a random vehicle and random pedmodel from the list below
Config.Taxi = {
    vehicles = {
        -- You can set different models
        'taxi',
        'taxi',
    },
    pedmodels = {
        -- You can set different models
        {name = 'Michael Reynold', model = 'a_m_y_stlat_01', voice = 'A_M_M_EASTSA_02_LATINO_FULL_01'},
        {name = 'John Smith', model = 'a_m_y_smartcaspat_01', voice = 'A_M_M_EASTSA_02_LATINO_FULL_01'},
    },
}

Resmon

  • Idle: 0.00ms
  • In use: ~0.07ms

Requirements

Optional Requirements

Code is accessible Yes
Subscription-based No
Lines (approximately) ~490
Requirements See Requirements above
Support Yes

My other Scripts

Paid

Free

5 Likes

Thx for the nice release

1 Like

I tried to setup different spawn locations, but cant figure out, how it works that it doesnt start allways at Down Town Cab, or isnt it really random?

It will always use the first location but if this location is blocked by a player or vehicle it will use the second location and so on

1 Like

Update v1.0.2

  • Added Support for QBCore
  • Added Config.SpawnRadius
  • Removed Config.SpawnCoords
  • Fixed that the vehicle won’t drive after spawn if distance too high
1 Like

Fun script! Thanks for creating and sharing. Some player used it, but taxi NPC went full mayhem and driven after 50 meters straight into a wall and keeps driving into it if you push it back on the road. (no custom road or mlo)

This did not happen in my tests. Are you already using the latest version v1.0.2?

Not yet sir! Im not that fast :stuck_out_tongue:

1 Like

Job Counter would be nice. when Job “taxi” is online then not working.
Only when no “taxi” online is working

1 Like

Im using the latest version (1.0.2) - but maybe i found something missing. in the first release, if i cancel a trip, the taxi stops, takes the money and i could get safe out of the taxi. But in version 1.0.2 the taxi keeps driving till it arrives my own set waypoint.

1 Like

I’ll fix that

Implemented with next update

1 Like

Update v1.1.0

  • Fixed that the Taxi doesn’t stop after canceling
  • Added Config.Jobs for Maximum players online in this jobs to call a taxi
1 Like

nice free release

Works perfect now, many thx for your nice work

1 Like

Idea: Would it be possible, that a taxi also spawns at Cayo Perico?
And then maybe a extra car that is only available at cayo?

I have a new question. Im using t1ger_keys and set all NPC-Cars locked inside its config. But now its impossible to enter the taxi because all doors are locked now. I can open the door anyways, but i cant enter into the vehicle,

I tried the following code (SetVehicleIndividualDoorsLocked(task.vehicle, 0, 2)) and changed the 2 into a 1 - but without effect.

The export from t1ger_keys for getting temporary keys looks loke that

exports['t1ger_keys']:GiveTemporaryKeys(plate, name, stolen)
-- plate; is the plate variable of the vehicle 
-- name; is the vehicle display name, using GetLabelText() and GetDisplayNameFromVehicleModel()
-- type; is the label shown in keys menu, after the plate.
-- I for example use: 'stolen' -for keys gotten from NPCs at gunpoint aim

But i cant figure out, there to place this export

Maybe a link to teh documentation would be helpfull: T1GER Keys | T1GER Scripts Documentation

The trip is not completely canceled upon completion of the journey. An error occurred for the next trip, the player cannot be a customer. They were converted into taxi robbers

Really dope release…
Only one bug with me… when he reaches the destination the taxi driver just stays there.
Also is there a way to change voices as well?
Everything else works great.