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.
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
addCommandHandler("fix", function(player)
local vehicle = getPedOccupiedVehicle(player)
if vehicle then
fixVehicle(vehicle)
end
end)