AI Core

Vehicles

Owned vehicles, keys, fuel, garages, shops, used car lots, rental, mechanics and emergency lights.

The vehicle scripts work together through AI Core: ai-vehicles stores every owned vehicle, and the other scripts buy, park, lock, fuel, repair and rent them. Keys, fuel and garages can each be replaced by a supported third-party script; the others keep working, because they ask AI Core instead of each other.

ScriptWhat it does
ai-vehiclesOwned vehicles of characters, jobs and gangs: the storage the other vehicle scripts build on. Stands in for qbx_vehicles.
ai-vehiclekeysKeys, locking (U), engine (M), lockpicking and hotwiring. Stands in for qbx_vehiclekeys.
ai-fuelFuel use and gas stations with a nozzle and hose; electric models burn nothing.
ai-garagesPublic, job and gang garages and impound lots with a fee.
ai-vehicleshopVehicle shops with a catalog, a showroom preview and colors.
ai-vehiclesalesUsed car lots: players list their vehicles, others test drive and buy; dealer buy-back.
ai-rentalRental points with a fee and a deposit.
ai-mechanicRepair, tuning with a live preview, job shops, car washes, repair kit.
ai-sirensEmergency lights, siren tones, airhorn and ONX lightbars.

How they fit together

A player buys a car at ai-vehicleshop. It is created in ai-vehicles, owned by their character, and comes out with the keys.

ai-vehiclekeys knows the owner from ai-vehicles: only the owner (or the members of an owning job or gang) can lock and start it.

ai-fuel burns the tank while driving; the level is saved with the vehicle.

ai-garages parks it with its look, fuel and damage. A vehicle lost in the world waits at the impound.

ai-mechanic repairs and tunes it. It is the only script that changes the car's stored tuning.

ai-vehiclesales lets the player sell it to another player, with the same plate, look and trunk.

Start order

In server.cfg, start ai-vehicles right after ai-core, then the other vehicle scripts. The AI Core recipe does this for you.

On this page