vehicleAppearanceChangeRequest
Asks your gamemode when a player’s game changes a vehicle’s look by itself: a mod shop fits a part or a paintjob, a paint shop resprays it. Vehicles your gamemode created are never asked: they always keep the look your gamemode gave them, and the player’s game is given it back. Number plates never change this way. A mod shop shows each part the player browses, so you may be asked several times while they choose. Only the player driving the vehicle is asked about; hydraulics the game fits to a lowrider by itself are kept without asking.
Signature
Section titled “Signature”server.on("vehicleAppearanceChangeRequest", ({ player, vehicleId, fromAppearance, toAppearance }) => boolean | void | Promise<boolean | void>)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerSnapshot |
The player whose game made the change. |
vehicleId |
number |
The vehicle’s network ID. |
fromAppearance |
VehicleAppearance |
The look every player sees now. |
toAppearance |
VehicleAppearance |
The look the player’s game made. |
Returns
Section titled “Returns”Return false to keep the old look: the player’s game is given it back and nobody else sees the change. Any other
answer keeps the new look, and vehicleAppearanceChanged follows. See
how decisions work.
Example
Section titled “Example”No paintjobs on the server’s cars.
import { server } from "nativemp";
server.on("vehicleAppearanceChangeRequest", ({ toAppearance }) => toAppearance.paintjob === null);Related
Section titled “Related”- How decisions work: deadline and handler rules
vehicleAppearanceChanged: a change was keptVehicleAppearanceChangeRequestPayload: decision payload