---
title: "OnVehicleSpawn | open.mp"
description: "This callback is called when a vehicle respawns."
canonical: https://omp.itsneufox.com/de/docs/scripting/callbacks/OnVehicleSpawn
language: de
---

# OnVehicleSpawn

warnung

This callback is called **only** when vehicle **re**spawns! CreateVehicle and AddStaticVehicle(Ex) **won't** trigger this callback.

## Description

This callback is called when a vehicle respawns.

| Name | Description |
| --- | --- |
| vehicleid | The ID of the vehicle that spawned. |

## Returns

0 - Will prevent other filterscripts from receiving this callback.

1 - Indicates that this callback will be passed to the next filterscript.

It is always called first in filterscripts.

## Examples

```c
public OnVehicleSpawn(vehicleid)
{
    printf("Vehicle %i spawned!", vehicleid);
    return 1;
}
```

## Related Callbacks

The following callbacks might be useful, as they're related to this callback in one way or another.

-   [OnVehicleDeath](https://omp.itsneufox.com/de/docs/scripting/callbacks/OnVehicleDeath): This callback is called when a vehicle is destroyed.
-   [OnPlayerSpawn](https://omp.itsneufox.com/de/docs/scripting/callbacks/OnPlayerSpawn): This callback is called when a player spawns.

## Related Functions

The following functions might be useful, as they're related to this callback in one way or another.

-   [SetVehicleToRespawn](https://omp.itsneufox.com/de/docs/scripting/functions/SetVehicleToRespawn): Respawn a vehicle.
-   [CreateVehicle](https://omp.itsneufox.com/de/docs/scripting/functions/CreateVehicle): Create a vehicle.
