set ARRMove[i].cX=GetUnitX(GetEnumUnit()) set ARRMove[i].cY=GetUnitY(GetEnumUnit())
if(ARRMove[i].cX== ARRMove[i].nX)and(ARRMove[i].cY== ARRMove[i].nY)then set ARRMove[i].moving=false else set ARRMove[i].moving=true endif
set ARRMove[i].nX=GetUnitX(GetEnumUnit()) set ARRMove[i].nY=GetUnitY(GetEnumUnit())
endfunction
privatefunction onLoop takesnothingreturnsnothing
callForGroup(CHECKUNITS,function EnumUnits)
endfunction
function AddUnit takesunit u returnsnothing
set counter = counter +1 set ARRMove[counter]= MoveData.create() set ARRMove[counter].witchunit= u set ARRMove[counter].cX=GetUnitX(u) set ARRMove[counter].cY=GetUnitY(u)
You could just register order events, but that wouldn't detect SetUnitX/SetUnitY.
EDIT: Although you could probably just hook SetUnitX/SetUnitY/SetUnitPosition and set the boolean to true. The rest you could probably just register the order events.
EDIT2: Then again, you also need to know when the SetUnitXY/Pos stops. =P
I will update the Script asap. I am reality new at using vJass and don't really understand every thing yet. Thanks for the feedback, will try to make it right :D