ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. fixVehicle

Function

fixVehicle

Server and clientVehiclesIdentical to MTA:SA

Repairs a vehicle to factory condition: 1000 health, and every door, body panel, lamp and wheel returns to undamaged; a wreck stops being a wreck. It also cancels a scheduled wreck respawn. For one second after the repair the server ignores damage reports from the game so the old damage does not come back. Colour, tuning and plate stay as they were.

Syntax

bool fixVehicle(vehicle vehicle)

Arguments

vehiclevehicle
The vehicle to repair.

Returns

true on success.

Example

addCommandHandler("napraw", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then
        fixVehicle(vehicle)
        outputChatBox("Pojazd naprawiony.", player, 0, 200, 0)
    end
end)

Notes

Client. In a client script it repairs the vehicle in this game; a vehicle this player drives passes its state on through sync, so others see the repair too.

See also