Thanks! ;D
i've managed to call the script using the eventhandler in the units init, but my script is having some teething problems. here it is:
_plane = _this select 0
?(not alive (_plane select 0) ): goto "Exit"
?(not isengineon (_plane select 0) ): goto "Exit"
_enemy = _plane select 2
_ammo = _plane select 1
_missile = nearestobject [_enemy, _ammo]
@ _missile distance (_plane select 0) < 300
_directionchange = 5 -random 10
_count =0
#repeat
(_plane) say "Incoming"
_newdirection = (direction _missile) + _directionchange
? (_newdirection > 360) : _newdirection = _newdir -360
? (_newdirection < 0) : _newdirection = _newdir +360
_missile setdirection _newdirection
drop["kouleSvetlo","","Billboard",0.05,6,[-.2,-3,1.1],[-6-random 6,- random 2,0],0,1.8,1,0,[1],[[1,1,0.3,1]],[0,1],0,0,"smoke.sqs","",(_plane)]
drop["kouleSvetlo","","Billboard",0.05,6,[.2,-3,1.1],[6+random 6,- random 2,0],0,1.8,1,0,[1],[[1,1,0.3,1]],[0,1],0,0,"smoke.sqs","",(_plane)]
(_plane) say "FlareLaunch"
~0.05
? (_count < 6) : goto repeat
#Exit
exit
so far ive identified problem with 2 lines first is the one that gives the _missile
second is the line that checks wether its within 300m