vehicles.getAppearance
Reads what a vehicle looks like now: the look your gamemode gave it, or a change a player made in a mod shop or paint shop that you allowed.
Signature
Section titled “Signature”vehicles.getAppearance(id: number): VehicleAppearance | undefinedParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
number |
The vehicle’s network ID. |
Returns
Section titled “Returns”An immutable VehicleAppearance, or undefined for an unknown vehicle.
Example
Section titled “Example”import { server, vehicles } from "nativemp";
server.on("playerEnteredVehicle", ({ player, vehicleId }) => { const look = vehicles.getAppearance(vehicleId); if (look?.numberPlate) server.log(`${player.name} got into the car with plate ${look.numberPlate}`);});Related
Section titled “Related”vehicles.setColors: change the colorsvehicles.setPaintjob: change the paintjobvehicles.addComponent: fit a componentvehicles.setNumberPlate: change the plate