ai-vehicles
Owned vehicles of characters, jobs and gangs. The storage every garage, shop, key and fuel script builds on.
ai-vehicles keeps every owned vehicle on the server: who owns it, its model and plate, where it is parked, its fuel and damage, and its look (colors, tuning, extras). Players never open it directly. They meet it through other scripts: a car bought at ai-vehicleshop is created here, ai-garages parks and takes it out, ai-vehiclekeys knows its owner from here.
What it does in the game
- Owners. A vehicle belongs to a character, a job fleet (every member may drive it), a gang fleet, or a script (a used car lot listing in ai-vehiclesales).
- Plates. Each vehicle gets a plate made from its number:
AIand six characters (for exampleAI00001A). Two vehicles never share a plate. - One car, one copy. A vehicle can be out in the world only once. If two members of a job try to take out the same fleet car at the same moment, the second one is refused.
- Lost vehicles. When a vehicle that is out disappears from the world (server restart, cleanup, a script deleting it), it moves to the impound. The owner gets it back at an impound lot of ai-garages.
- Look and tuning. The look a garage saves on parking (colors, extras, dirt, damage) is kept, but parking never changes the tuning. Only a tuning shop (ai-mechanic) saves engine, brakes, turbo, neon and other mods. A mod menu used by a cheater is lost the next time the car is parked.
Installation
The AI Core txAdmin recipe installs it. By hand: put the folder in resources/[ai]/ and add ensure ai-vehicles to server.cfg after ensure ai-core. It needs OneSync and ai-core. The table ai_vehicles_owned is created on the first start.
Start it before the scripts that use it: ai-garages, ai-vehicleshop, ai-vehiclesales, ai-rental, ai-mechanic and ai-vehiclekeys.
Panel settings
None. ai-vehicles has no tab in the admin panel: garages, shops and prices are set in the scripts that use it.
Commands and keybinds
None.
What it stands in for
fxProvide: qbx_vehicles. Qbox scripts that call exports.qbx_vehicles:GetPlayerVehicles(...) and the other qbx_vehicles exports reach ai-vehicles, so Qbox garages, shops and tuning scripts see owned vehicles without changes. The full list is on the developer page.
Known limits
- Only vehicles in memory are visible to other scripts: those of characters who are online, and every job and gang fleet. A vehicle of an offline character stays in the database until that character joins.
- The qbx_vehicles stand-in filters by citizen id only while that character is online.
depotPricein the qbx_vehicles answers is always0; the impound fee is set in ai-garages.