Skip to content

vehicles.listOwn

The vehicles your gamemode created with vehicles.create. Use it after your gamemode restarts, to find the vehicles it created before.

Renamed in 0.28 from vehicles.all; see renamed names.

vehicles.listOwn(): readonly Entity[]

None.

The vehicles, each with its id, model and position.

gamemodes/my-mode.ts
import { vehicles } from "nativemp";
if (vehicles.listOwn().length === 0) {
await vehicles.create({ model: 411, position: [2495, -1680, 13.3] }); // only the first time the gamemode starts
}