---
title: "SetVehicleToRespawn | open.mp"
description: "Sets a vehicle back to the position at where it was created."
canonical: https://omp.itsneufox.com/docs/scripting/functions/SetVehicleToRespawn
language: en
---

# SetVehicleToRespawn

## Description

Sets a vehicle back to the position at where it was created.

| Name | Description |
| --- | --- |
| vehicleid | The ID of the vehicle to respawn |

## Returns

**true** - The function executed successfully.

**false** - The function failed to execute. The vehicle does not exist.

## Examples

```c
// Respawns the all vehicles
for (new i = 1; i < MAX_VEHICLES; i++)
{
    SetVehicleToRespawn(i);
}
```

## Related Functions

-   [CreateVehicle](https://omp.itsneufox.com/docs/scripting/functions/CreateVehicle): Create a vehicle.
-   [DestroyVehicle](https://omp.itsneufox.com/docs/scripting/functions/DestroyVehicle): Destroy a vehicle.
