playerChangedVehicleSeat
Tells your gamemode when a player moves from one seat to another without leaving the vehicle.
Renamed in 0.28 from seatChange; see renamed names.
Signature
Section titled “Signature”server.on("playerChangedVehicleSeat", ({ player, vehicleId, fromSeat, toSeat }) => void)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerSnapshot |
The player. |
vehicleId |
number |
The vehicle. |
fromSeat |
number |
The seat they left. |
toSeat |
number |
The seat they took; 0 is the driver’s. |
Example
Section titled “Example”import { server } from "nativemp";
server.on("playerChangedVehicleSeat", ({ player, toSeat }) => { if (toSeat === 0) server.log(`${player.name} took the wheel`);});Related
Section titled “Related”playerEnteredVehicle: getting inplayerExitedVehicle: getting out