Юниты записаны в массив? Если нет, вот универсальная функция:Code
globals
constant group udg_Group = CreateGroup()
real SumHealthResult
boolexpr SumHealthBool
endglobals
function SumHealthUnitsOfPlayer_filter takes nothing returns boolean
set SumHealthResult = SumHealthResult + GetWidgetLife(GetFilterUnit())
return false
endfunction
function GetSumHealthUnitsOfPlayer takes player p returns real
set SumHealthResult = .0
call GroupEnumUnitsOfPlayer(udg_Group, p, SumHealthBool)
return SumHealthResult
endfunction
function InitGetSumHealthUnitsOfPlayer takes nothing returns nothing
set SumHealthBool = Filter(function SumHealthUnitsOfPlayer_filter)
endfunction