FixVehicle: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Incomplete]]
__NOTOC__
 
{{Server client function}}
__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 [[setElementHealth]].
This fake function is for use with blah & blah and does blahblahblabhalbhl


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool fixVehicle ( element vehicle )             
bool fixVehicle ( vehicle theVehicle )             
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP||[[vehicle]]:fix}}
===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''theVehicle:''' the vehicle you wish to fix
 
===Optional Arguments===
{{OptionalArg}}
*'''argumentName2:''' descriptiona
*'''argumentName3:''' description


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


==Example==  
==Example==  
This example does...
This example fixes all the vehicles that exist in the map.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
-- Retrieve a table containing all the vehicles that exist
blabhalbalhb --abababa
local vehicles = getElementsByType("vehicle")
--This line does this...
 
mooo
-- 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
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{FunctionArea_Functions}}
{{Vehicle_functions}}

Latest revision as of 13:34, 7 May 2018

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.

Syntax

bool fixVehicle ( vehicle theVehicle )             

OOP Syntax Help! I don't understand this!

Method: vehicle:fix(...)


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