[JASS] GetUnitLife without %

Status
Not open for further replies.
JASS:
native GetWidgetLife takes widget whichWidget returns real
constant native GetUnitState takes unit whichUnit,unitstate whichUnitState returns real

constant unitstate UNIT_STATE_LIFE=ConvertUnitState(0)
constant unitstate UNIT_STATE_MAX_LIFE=ConvertUnitState(1)

The function you mention does not even exist as far as I can tell...
 
If you want to get the unit's current life, use GetWidgetLife(whichUnit).
However, if you want to get the unit's current mana, maximum mana or maximum life, you must use GetUnitState(whichUnit, whichUnitState).
The available unit states are:
JASS:
UNIT_STATE_LIFE
UNIT_STATE_MAX_LIFE
UNIT_STATE_MANA
UNIT_STATE_MAX_MANA
 
ok ty all. (and yes, i confused with SetUnitLifePercentBJ ;))

but GetWiigdetLife takes a widget, and magtheridon say "you can use GetWidgetLife(unit)" and after "GetWidgetLife also works for destructables and items."

i don't understand :/
 
Status
Not open for further replies.
Back
Top