Skip to content

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.

vehicles.setPaintjob(id: number, paintjob: number | null): Promise<ActionResult>
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.

A promise of an ActionResult: "applied", or rejected with invalid-paintjob (the model has no such paintjob) or vehicle-not-found.

gamemodes/my-mode.ts
import { vehicles } from "nativemp";
const created = await vehicles.create({ model: 562, position: [2495, -1680, 13.3] }); // an Elegy: three paintjobs
if (created.status === "applied" && created.createdId !== undefined) await vehicles.setPaintjob(created.createdId, 1);