vehicles.respawn
Puts a vehicle you created with vehicles.create back where you created it, as new.
Signature
Section titled “Signature”vehicles.respawn(id: number): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
number |
The vehicle’s ID, from vehicles.create. |
Returns
Section titled “Returns”A promise of an ActionResult: applied, or rejected with vehicle-occupied,
vehicle-not-found or invalid-vehicle-id, as for vehicles.destroy.
Example
Section titled “Example”import { commands, vehicles } from "nativemp";
commands.register("resetcars", async () => { for (const vehicle of vehicles.listOwn()) await vehicles.respawn(vehicle.id);});Related
Section titled “Related”vehicles.create: where it goes back to, andrespawnDelaySecondsvehicleRespawnRequest: the automatic respawns