---
title: "VehicleCanHaveComponent | open.mp"
description: "آیا این کامپوننت روی مدل وسیله نقلیه مجاز هست؟"
canonical: https://omp.itsneufox.com/fa/docs/scripting/functions/VehicleCanHaveComponent
language: fa
---

# VehicleCanHaveComponent

هشدار

This function was added in omp v1.1.0.2612 and will not work in earlier versions!

## توضیحات

آیا این کامپوننت روی مدل وسیله نقلیه مجاز هست؟

| نام | توضیحات |
| --- | --- |
| [modelid](https://omp.itsneufox.com/fa/docs/scripting/resources/vehicleid) | ID مدل وسیله نقلیه |
| [component](https://omp.itsneufox.com/fa/docs/scripting/resources/carcomponentid) | ID کامپوننتی که می‌خوای چک کنی. |

## مقدار برگشتی

**true** - کامپوننت روی وسیله نقلیه مجاز هست.

**false** - کامپوننت روی وسیله نقلیه غیرمجاز هست.

## مثال‌ها

```c
new vehicleid = GetPlayerVehicleID(playerid);

if (VehicleCanHaveComponent(GetVehicleModel(vehicleid), 1010))
{
    SendClientMessage(playerid, 0x00FF00FF, "Nitro is legal on this vehicle.");
    // Nitro roye in vasile mojaz hast
}
else
{
    SendClientMessage(playerid, 0xFF0000FF, "Nitro is illegal on this vehicle.");
    // Nitro roye in vasile gheyre mojaz hast
}
```

## توابع مرتبط

-   [AddVehicleComponent](https://omp.itsneufox.com/fa/docs/scripting/functions/AddVehicleComponent): یک کامپوننت به وسیله نقلیه اضافه کن.
-   [RemoveVehicleComponent](https://omp.itsneufox.com/fa/docs/scripting/functions/RemoveVehicleComponent): یک کامپوننت رو از وسیله نقلیه حذف کن.
-   [GetVehicleComponentInSlot](https://omp.itsneufox.com/fa/docs/scripting/functions/GetVehicleComponentInSlot): چک کن که وسیله نقلیه چه کامپوننت‌هایی داره.
-   [GetVehicleComponentType](https://omp.itsneufox.com/fa/docs/scripting/functions/GetVehicleComponentType): نوع کامپوننت رو از طریق ID چک کن.

## منابع مرتبط

-   [Car Component IDs](https://omp.itsneufox.com/fa/docs/scripting/resources/carcomponentid)
