Difference between revisions of "DCS func getLife0"

From DCS World Wiki - Hoggitworld.com
m (1 revision imported)
(No difference)

Revision as of 00:12, 12 April 2018

Scripting Root

Envrioment: Mission Scripting
Function: getLife0 Added with: 1.2.0
Member Of: Unit
Syntax: number Unit.getLife0(Class Self )
Description: Returns the initial life value of a unit. All units spawn with "max HP" and this value will never change. Can be used with Unit.getLife() to determine the percentage of a units life as each unit has a unique life value.


Return Value: number
Return Example: 9
Examples: The following example will show the percentage of life left for a given unit.
 local tank = Unit.getByName('tank1')
 local life = tank:getLife()/tank:getLife0()
Related Functions: Unit Functions: isActive, getPlayerName, getID, getNumber, getCategoryEx, getObjectID, getController, getGroup, getCallsign, getLife, getLife0, getFuel, getAmmo, getSensors, hasSensors, getRadar, getDrawArgumentValue, getNearestCargos, enableEmission, getDescentCapacity

Object Functions: isExist, destroy, getCategory, getTypeName, getDesc, hasAttribute, getName, getPoint, getPosition, getVelocity, inAir

Coalition Object Functions: getCoalition, getCountry

Notes: