hey guys,
imagine: u have a unit and a building. the unit is owned by players red and the building is neutral aggressive.
so if the unit stands next to the building it attacks the building.
how can i ask for that event?
looks like "EVENT_PLAYER_UNIT_ATTACKED" doesnt work for that. or maybe my script just doesnt work....
i have to say that i want the script JUST to trigger when the attacking units id = npn2 , but you can see that in the script^^
here's the script:
i think this should work, but it doesnt...
everyone who helps me gets +rep =)
imagine: u have a unit and a building. the unit is owned by players red and the building is neutral aggressive.
so if the unit stands next to the building it attacks the building.
how can i ask for that event?
looks like "EVENT_PLAYER_UNIT_ATTACKED" doesnt work for that. or maybe my script just doesnt work....
i have to say that i want the script JUST to trigger when the attacking units id = npn2 , but you can see that in the script^^
here's the script:
JASS:
function Trig_AdminAttack_Conditions takes nothing returns boolean
return(not(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetAttacker()))))
endfunction
function Trig_AdminAttack_Actions takes nothing returns nothing
if (GetUnitTypeId(GetAttacker())=='npn2') then
call DisplayTimedTextToForce(GetPlayersAll(),30,"blablabla")
endif
endfunction
...
call TriggerRegisterAnyUnitEventBJ(udg_trigger99,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(udg_trigger99,Condition(function Trig_AdminAttack_Conditions))
call TriggerAddAction(udg_trigger99,function Trig_AdminAttack_Actions)
...
set udg_trigger99=CreateTrigger()
i think this should work, but it doesnt...
everyone who helps me gets +rep =)