Skip to content

playerExitedVehicle

Tells your gamemode that a player got out of a vehicle.

Coming from SA-MP or open.mp: OnPlayerExitVehicle comes when a player starts to get out; this event comes once they are out. OnPlayerEnterVehicle is playerEnterVehicleRequest.

Renamed in 0.28 from exitVehicle; see renamed names.

Moving the player out with players.setPosition, or into another vehicle with players.putInVehicle, sends it too, before the new entry. With setPosition’s includeVehicle the player stays in the vehicle and nothing is sent.

server.on("playerExitedVehicle", ({ player, vehicleId, seat }) => void)
Name Type Description
player PlayerSnapshot The player.
vehicleId number The vehicle.
seat number 0 for the driver’s seat, 1 to 3 passenger seats.
gamemodes/my-mode.ts
import { chat, server } from "nativemp";
server.on("playerExitedVehicle", ({ player, seat }) => {
chat.sendServerMessage(seat === 0 ? "Out of the driver seat." : "Thanks for riding.", player);
});