• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[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