VehicleCanHaveComponent
cảnh báo
Đã thêm hàm trong phiên bản omp v1.1.0.2612. Mục này không hoạt động trên các phiên bản cũ hơn!
Description
Is the component legal on the vehicle model?
| Name | Description |
|---|---|
| modelid | Vehicle Model ID |
| component | ID of the component to check. |
Returns
true - The component is legal on the vehicle.
false - The component is illegal on the vehicle.
Examples
new vehicleid = GetPlayerVehicleID(playerid);
if (VehicleCanHaveComponent(GetVehicleModel(vehicleid), 1010))
{
SendClientMessage(playerid, 0x00FF00FF, "Nitro is legal on this vehicle.");
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "Nitro is illegal on this vehicle.");
}
Related Functions
- AddVehicleComponent: Add a component to a vehicle.
- RemoveVehicleComponent: Remove a component from a vehicle.
- GetVehicleComponentInSlot: Check what components a vehicle has.
- GetVehicleComponentType: Check the type of component via the ID.