JASS:
library Waypoint initializer Init
globals
private unit array ward
private integer array current
private hashtable waypointHash = InitHashtable()
private integer array currentMenu
private dialog array main
private button array bttn
private integer array cont1
private integer array cont2
private integer array cont3
private integer array cont4
endglobals
private function onWardInteract_Cond takes nothing returns boolean
call print("12345")
return GetUnitTypeId(GetOrderTargetUnit()) == 'H00P' or GetUnitTypeId(GetTriggerUnit()) == 'H00P'
endfunction
private function onWardInteract takes nothing returns nothing
local unit ward = GetOrderTargetUnit()
local unit trig = GetTriggerUnit()
local integer play = GetPlayerId(GetOwningPlayer(trig))
call print(I2S(play))
. . .
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i
call print("wtf")
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER)
call TriggerAddAction(t, function onWardInteract)
call TriggerAddCondition(t, Condition(function onWardInteract_Cond))
set t = CreateTrigger()
. . .
endfunction
endlibrary
When im ordering my unit towards the unit ('H00P'), it prints 12345 but it doesnt print play.