Vehicle::getEngineHealth: Difference between revisions

From RAGE Multiplayer Wiki
Line 30: Line 30:


==Example==
==Example==
<syntaxhighlight lang="javascript">
<pre>
function getEngineHealth(){
function getEngineHealth(){


Line 39: Line 39:
  return engineHealth; // returns the value of the engine health as a float
  return engineHealth; // returns the value of the engine health as a float
}
}
</syntaxhighlight>
</pre>


==See also==
==See also==

Revision as of 17:46, 16 August 2018

Engine Health Status
1000 Perfect - Undamaged
< 1000 Damaged
< 400 Engine is smoking and losing functionality
0 Engine stops working and car is not drivable
< 0 Engine catches fire, health rapidly declines and blows up seconds later

Maximum: 1000
Minimum: -4000
Note*: Returns 1000.0 if the function is unable to get the address of the specified vehicle or if it's not a vehicle.

Syntax

vehicle.getEngineHealth();

Required Arguments

Return value

  • float

Example

function getEngineHealth(){

 let engineHealth = vehicle.getEngineHealth();

 mp.gui.chat.push(`engine health: ${engineHealth}`);

 return engineHealth; // returns the value of the engine health as a float
}

See also