Jass:GetUnitStatePercent
Aus Mappedia
| Funktion: GetUnitStatePercent | |
|---|---|
| Parameter: | unit unitstate unitstate |
| Rückgabewert: | real |
| Autor: | Blizzard |
| Quelle: | Blizzard.j |
| Synchron: | Unbekannt |
Code
function GetUnitStatePercent takes unit whichUnit, unitstate whichState, unitstate whichMaxState returns real local real value = GetUnitState(whichUnit, whichState) local real maxValue = GetUnitState(whichUnit, whichMaxState) // Return 0 for null units. if (whichUnit == null) or (maxValue == 0) then return 0.0 endif return value / maxValue * 100.0 endfunction
Parameter
| Typ | Name | Beschreibung |
|---|---|---|
| unit | whichUnit | |
| unitstate | whichState | |
| unitstate | whichMaxState |
