# fixVehicle (Shared)

> Repairs a vehicle completely: its health goes back to 1000 and its doors, wheels and lights to their initial state, with no dents or bullet holes.

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

## Syntax

```lua
bool fixVehicle(element vehicle)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `vehicle` | `element` | The vehicle, or a parent element whose vehicles all change. |

## Returns

`true` if the vehicle was repaired, `false` if the element is not a vehicle.

On the server, the doors are also closed. 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("fix", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then
        fixVehicle(vehicle)
    end
end)
```

## See also

- [setElementHealth (Shared)](https://wiki.mymp.gg/en/setElementHealth.md): Sets the health of a ped, player, vehicle or object.
- [setVehicleDoorState (Shared)](https://wiki.mymp.gg/en/setVehicleDoorState.md): Changes the state of one or more doors of a vehicle: shut, open, damaged or missing.
- [setVehicleWheelStates (Shared)](https://wiki.mymp.gg/en/setVehicleWheelStates.md): Changes the state of a vehicle's four wheels at once.
