From Multi Theft Auto: Wiki

Revision as of 16:27, 3 February 2008 by Peter (Talk | contribs)

Jump to: navigation, search

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.


bool fixVehicle ( vehicle theVehicle )

Required Arguments

  • theVehicle: The vehicle you wish to fix


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


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

-- Retrieve a table containing all the vehicles that exist
vehicles = getElementsByType ( "vehicle" )
-- Loop through the list, storing the vehicle from the table in the variable vehicleValue
for vehicleKey, vehicleValue in ipairs(vehicles) do
	-- fix the vehicle
	fixVehicle ( vehicleValue )

See Also

Personal tools