Gtam
Lerning how to write and read!! Yeah.
- Reaction score
- 164
Title says it all
function CategorizeGroupEnum takes nothing returns nothing
local unit testunit = GetEnumUnit()
set bj_groupCountUnits = bj_groupCountUnits + 1
if IsUnitType(testunit, UNIT_TYPE_FLYING) then
set udg_unitTypeCount[3] = udg_unitTypeCount[3] + 1
elseif IsUnitType(testunit, UNIT_TYPE_MELEE_ATTACKER) then
set udg_unitTypeCount[0] = udg_unitTypeCount[0] + 1
elseif GetUnitState(testunit, UNIT_STATE_MAX_MANA) >= 200 then
set udg_unitTypeCount[2] = udg_unitTypeCount[2] + 1
elseif IsUnitType(testunit, UNIT_TYPE_RANGED_ATTACKER) then
set udg_unitTypeCount[1] = udg_unitTypeCount[1] + 1
endif
if IsUnitType(testunit, UNIT_TYPE_ATTACKS_FLYING) then
set udg_unitTypeCount[6] = udg_unitTypeCount[6] + 1
else
set udg_unitTypeCount[5] = udg_unitTypeCount[5] + 1
endif
set testunit = null
endfunction
function CategorizeGroup takes group testGroup returns nothing
set bj_groupCountUnits = 0
set udg_unitTypeCount[0] = 0
set udg_unitTypeCount[1] = 0
set udg_unitTypeCount[2] = 0
set udg_unitTypeCount[3] = 0
set udg_unitTypeCount[4] = 0
set udg_unitTypeCount[5] = 0
set udg_unitTypeCount[6] = 0
call ForGroup(testGroup, function CategorizeGroupEnum)
endfunction
No i wan when a player types bla it displays how many of each unittype he has currently selected
No if he types some thing i want it to display how many unit of each type in the currently selected units