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.
| Script | What it does |
|---|---|
| ai-vehicles | Owned vehicles of characters, jobs and gangs: the storage the other vehicle scripts build on. Stands in for qbx_vehicles. |
| ai-vehiclekeys | Keys, locking (U), engine (M), lockpicking and hotwiring. Stands in for qbx_vehiclekeys. |
| ai-fuel | Fuel use and gas stations with a nozzle and hose; electric models burn nothing. |
| ai-garages | Public, job and gang garages and impound lots with a fee. |
| ai-vehicleshop | Vehicle shops with a catalog, a showroom preview and colors. |
| ai-vehiclesales | Used car lots: players list their vehicles, others test drive and buy; dealer buy-back. |
| ai-rental | Rental points with a fee and a deposit. |
| ai-mechanic | Repair, tuning with a live preview, job shops, car washes, repair kit. |
| ai-sirens | Emergency 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.