Difference between revisions of "DCS func getLife"

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: getLife Added with: 1.2.0
Member Of: Unit, Static Object, Scenery Object
Syntax: number Unit.getLife(Class Self )
Description: Returns the current "life" of a unit. Also referred to as "hit points". All units in DCS have a value that defines how much life is left. If this value is less than 1 the unit is considered "dead". Ground and ship units that are on fire and in the process of "cooking off" will return a life value of 0 until the object explodes. Aircraft are more complex due to sub-systems and damage models which will effect the life value.


Return Value: number
Return Example: 9
Examples:
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: