FixVehicle: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
__NOTOC__  
{{Server client function}}
This function will set a [[vehicle]]'s health to full and fix it's damage model. If you wish to just change the vehicle's health, without affecting it's damage model, use [[setVehicleHealth]].
__NOTOC__
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 [[setVehicleHealth]].


==Syntax==  
==Syntax==  
Line 11: Line 12:


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


==Example==  
==Example==  

Revision as of 12:42, 21 August 2007

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 setVehicleHealth.

Syntax

bool fixVehicle ( vehicle theVehicle )             

Required Arguments

  • theVehicle: The vehicle you wish to fix

Returns

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

Example

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 )
end

See Also