Skip to content

vehicles.respawn

Puts a vehicle you created with vehicles.create back where you created it, as new.

vehicles.respawn(id: number): Promise<ActionResult>
Name Type Description
id number The vehicle’s ID, from vehicles.create.

A promise of an ActionResult: applied, or rejected with vehicle-occupied, vehicle-not-found or invalid-vehicle-id, as for vehicles.destroy.

gamemodes/my-mode.ts
import { commands, vehicles } from "nativemp";
commands.register("resetcars", async () => {
for (const vehicle of vehicles.listOwn()) await vehicles.respawn(vehicle.id);
});