vehicles.getPaintjobCount
Answers what a stock vehicle model can wear, from the game’s own data: how many paintjobs it has, which components a mod shop fits to it, and which slot a component goes in. Wheels, the stereo and hydraulics fit every car.
Signature
Section titled “Signature”vehicles.getPaintjobCount(model: number): numbervehicles.listCompatibleComponents(model: number): readonly number[]vehicles.isComponentCompatible(model: number, component: number): booleanvehicles.getComponentSlot(component: number): VehicleComponentSlot | undefinedParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
model |
number |
A vehicle model ID, 400-611. |
component |
number |
A component model ID, 1000-1193. |
Returns
Section titled “Returns”getPaintjobCount: 0 to 3 (0 for an unknown model). listCompatibleComponents: the component IDs in ascending order,
empty for a model that takes none. isComponentCompatible: whether the model takes it. getComponentSlot: the
VehicleComponentSlot, or undefined for no component.
Example
Section titled “Example”import { server, vehicles } from "nativemp";
for (const model of [562, 411, 522]) { const spoilers = vehicles.listCompatibleComponents(model).filter((c) => vehicles.getComponentSlot(c) === "spoiler"); server.log(`${model}: ${vehicles.getPaintjobCount(model)} paintjobs, ${spoilers.length} spoilers`);}Related
Section titled “Related”vehicles.setPaintjob: put a paintjob onvehicles.addComponent: fit a component