fixVehicle | Multi Theft Auto: Wiki Skip to content

fixVehicle

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function will set a vehicle's health to full and fix its damage model. If you wish to only change the vehicle's health, without affecting its damage model, use setElementHealth.

OOP Syntax Help! I don't understand this!

Syntax

bool fixVehicle ( vehicle theVehicle )
Required Arguments
  • theVehicle: the vehicle you wish to fix

Returns

  • bool: value

Returns true if the vehicle was fixed, false if theVehicle is invalid.

Code Examples

shared

This example fixes all the vehicles that exist in the map.

-- Retrieve a table containing all the vehicles that exist
local vehicles = getElementsByType("vehicle")
-- Loop through the table, storing the vehicle from the table in a variable called "vehicle"
for _, vehicle in pairs(vehicles) do
-- Fix the vehicle
fixVehicle(vehicle)
end

See Also

Vehicle Functions