vehicles.setPaintjob
Puts one of the model’s own paintjobs on a vehicle for every player, or takes it off. Only some models have
paintjobs: vehicles.getPaintjobCount tells you how many. The
vehicle keeps its colors under the paintjob.
Signature
Section titled “Signature”vehicles.setPaintjob(id: number, paintjob: number | null): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
number |
The vehicle’s network ID. |
paintjob |
number | null |
The paintjob, from 0 to the model’s count minus 1. null takes it off. |
Returns
Section titled “Returns”A promise of an ActionResult: "applied", or rejected with invalid-paintjob (the
model has no such paintjob) or vehicle-not-found.
Example
Section titled “Example”import { vehicles } from "nativemp";
const created = await vehicles.create({ model: 562, position: [2495, -1680, 13.3] }); // an Elegy: three paintjobsif (created.status === "applied" && created.createdId !== undefined) await vehicles.setPaintjob(created.createdId, 1);Related
Section titled “Related”vehicles.getPaintjobCount: which models have paintjobsvehicles.getAppearance: read the paintjob