vehicleAppearanceChanged
Tells your gamemode that a vehicle’s look changed and every player sees it: your gamemode set it, a player changed it
in a mod shop or paint shop and you allowed it, the game fitted a lowrider’s own hydraulics (some come with them), or
your vehicle respawned with the look you created it with.
vehicles.getAppearance already returns the new look.
Signature
Section titled “Signature”server.on("vehicleAppearanceChanged", ({ vehicleId, fromAppearance, toAppearance, changeSource, player, observedAtSessionMs }) => void)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
vehicleId |
number |
The vehicle’s network ID. |
fromAppearance |
VehicleAppearance |
The look before. |
toAppearance |
VehicleAppearance |
The look now. |
changeSource |
"script" | "game" | "respawn" |
Your gamemode, the game (a player in a shop, or hydraulics the game fitted to a lowrider by itself), or a respawn. |
player |
PlayerSnapshot | null |
The player who made a "game" change in a shop; null for hydraulics the game fitted by itself, and for the other sources. |
observedAtSessionMs |
number |
When the server saw the change, on the shared session clock. |
Example
Section titled “Example”import { server } from "nativemp";
server.on("vehicleAppearanceChanged", ({ player, toAppearance, changeSource }) => { if (changeSource === "game" && player) server.log(`${player.name} tuned a car: ${toAppearance.components.length} parts`);});Related
Section titled “Related”vehicleAppearanceChangeRequest: refuse a shop changeVehicleAppearanceChangedPayload: event payload