Skip to content

vehicleStateRemoved

Tells your gamemode when a vehicle leaves the shared world. The SDK removes that vehicle’s state and siren snapshots before your handler runs. Moving out of scope or handing simulation to another player does not remove the vehicle.

server.on("vehicleStateRemoved", ({ vehicleId, observedAtSessionMs }) => void)
Name Type Description
vehicleId number The vehicle’s network ID.
observedAtSessionMs number When the vehicle left on the shared session clock.
gamemodes/my-mode.ts
import { server, vehicles } from "nativemp";
server.on("vehicleStateRemoved", ({ vehicleId }) => {
server.log(`Vehicle ${vehicleId} removed; snapshot: ${vehicles.getState(vehicleId) ?? "gone"}`);
});