# removeVehicleUpgrade (Shared)

> Takes a tuning upgrade off a vehicle.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Vehicles
- **URL**: https://wiki.mymp.gg/en/removeVehicleUpgrade

## Syntax

```lua
bool removeVehicleUpgrade(element vehicle, string upgrade)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `vehicle` | `element` | The vehicle, or a parent element whose vehicles all lose the upgrade. |
| `upgrade` | `string` | The upgrade's model name (case does not matter). |

## Returns

`true` if it was removed. `false` if that upgrade is not fitted on the vehicle or the element is not a vehicle.

Given a parent element such as `root`, it applies to every vehicle below it, but the value returned is the element's own: `false` when it is not a vehicle.

## Example

```lua
addCommandHandler("destunar", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if not vehicle then return end
    for _, upgrade in ipairs(getVehicleUpgrades(vehicle)) do
        removeVehicleUpgrade(vehicle, upgrade)
    end
end)
```

### Coming from MTA

MTA uses numeric upgrade ids (1000 to 1193). Here an upgrade is its model's name, and the slots are the ones the mounted packs declare.

## See also

- [addVehicleUpgrade (Shared)](https://wiki.mymp.gg/en/addVehicleUpgrade.md): Fits a tuning upgrade on a vehicle, replacing whatever is on the same slot.
- [getVehicleUpgrades (Shared)](https://wiki.mymp.gg/en/getVehicleUpgrades.md): Returns every tuning upgrade fitted on a vehicle.
- [getVehicleUpgradeOnSlot (Shared)](https://wiki.mymp.gg/en/getVehicleUpgradeOnSlot.md): Returns the upgrade fitted on one slot of a vehicle.
