> For the complete documentation index, see [llms.txt](https://gley.gitbook.io/mobile-traffic-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gley.gitbook.io/mobile-traffic-system/complete-api/addexcludedvehicletosystem.md).

# AddExcludedVehicleToSystem

### Description

Excluded vehicles are a special kind of vehicle marked as **Don't Instantiate** inside the Vehicle Pool. These vehicles will not be instantiated by the system unless the user specifies to be instantiated using this method. Read more about them [Vehicle Pool](/mobile-traffic-system/setup-guide/vehicle-pool.md#add-vehicles-to-the-pool)

The AddExcludedVehicleToSystem adds a previously excluded vehicle back to the Traffic System and the vehicle behaves normally.

### Declaration&#x20;

```csharp
public static void AddExcludedVehicleToSystem(int vehicleIndex)
```

### Parameters

<table><thead><tr><th width="188">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>vehicleIndex</strong></td><td>Index of the vehicle to be added back to the system</td></tr></tbody></table>

### Example

```csharp
using Gley.TrafficSystem;
using UnityEngine;

public class Test : MonoBehaviour
{
    //a reference to vehicle pool and player assigned in inspector
    public VehiclePool vehiclePool;
    public Transform player;

    void Start()
    {
        API.Initialize(player, 20, vehiclePool);
    }

    public void AddVehicle()
    {
        //0 - is an example index of the vehicle
        API.AddExcludedVehicleToSystem(0);
    }
}

```
