CountLivingPlayerUnitsOfTypeId

Parameters
unitId integer
whichPlayer player
return type
integer
Source code
function CountLivingPlayerUnitsOfTypeId takes integer unitId, player whichPlayer returns integer
    local group g
    local integer matchedCount

    set g = CreateGroup()
    set bj_livingPlayerUnitsTypeId = unitId
    call GroupEnumUnitsOfPlayer(g, whichPlayer, filterLivingPlayerUnitsOfTypeId)
    set matchedCount = CountUnitsInGroup(g)
    call DestroyGroup(g)

    return matchedCount
endfunction
Source
Blizzard.j
wc3modding.com
CountLivingPlayerUnitsOfTypeId