- Joined
- Jun 28, 2008
- Messages
- 776
I am still new to JASS so I don't know all the tricks.
How can I use a unit(lets call him u) in a Unit Group Function example :
I tried the Local Handel Vars system, but I can't seem to get it to work with a group.
Please help me for I am clueless...
Thanks in advance
How can I use a unit(lets call him u) in a Unit Group Function example :
JASS:
function Damage_Units takes nothing returns nothing
local unit u // ??? how do I get u from function main to function Damage_Unit
call UnitDamageTargetBJ(u,GetEnumUnit(), 500, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
endfunction
function Main takes nothing returns nothing
local unit u = GetTriggerUnit()
local group g = null
local location point1 = GetUnitLoc(u)
set g = GetUnitsInRangeOfLocAll(900, point1)
call ForGroupBJ(g, function Damage_Units)
endfunction
I tried the Local Handel Vars system, but I can't seem to get it to work with a group.
Please help me for I am clueless...
Thanks in advance