I had something similar in one of my many unfinished...forgotten missions and Dinger (Thanks Dinger
) wrote the code for me to make the plane blow up and the pilot eject.
Here is the code
removeallweapons AAdude
AAdude addmagazine "9K32Launcher"
AAdude addweapon "9K32Launcher"
AAdude reveal MyA10
AAdude dotarget MyA10
AAdude setcombatmode "BLUE"
~10
AAdude reveal MyA10
AAdude dofire MyA10
_a10driver = MyA10d
_cam camsettarget MyA10
~1
_cam camcommit 1
@(not(someammo AAdude))
_A10driver setpos [0, 0, 1000]
;don't keep him hanging for long
AAdude setcombatmode "RED"
~.3
_cam camsetpos getpos MyA10
_cam camsetFOV .5
_cam camcommit 1
~.5
;vary this time as necessary for missile flight
~.1
bombloc = getpos MyA10
~.4
;modify delay above as necessary for effect of exploding behind aircraft
;if you want, you can use
;?(Getdammage MyA10 > .9):goto "SkipBombs"
bomb1 = "HEAT120" camcreate bombloc
bomb2 = "HEAT120" camcreate bombloc
#SkipBombs
~.5
myA10 setdammage 0
_A10driver moveindriver MyA10
_a10driver setdammage 0
~.5
_a10driver action ["Eject", MyA10]
mya10 setdammage .99
~2
MyA10 setdammage 4
~3
_chute = vehicle _A10Driver
_cam camsettarget _chute
_Cam camcommit 3
~3
;now set off the ordnance for some nice secondaries
bomb1 = "LaserGuidedBomb" camcreate getpos MyA10
bomb2 = "LaserGuidedBomb" camcreate getpos MyA10
MyA10 setpos [0, 0, 0]
_waittime = _Time + 11
@((getpos _chute select 2)<2)
_cam cameraeffect ["Terminate", "Back"]
camdestroy _cam
exit
this uses an AA soldier to shoot the plane but those bits could be removed for a shilka
also the best bit is the little switch Dinger played with the pilot so he is not in the plane when it blows up so he can't die ;D....Or at least he shouldn't...
_A10driver setpos [0, 0, 1000]
.
.
.
.
.
myA10 setdammage 0
_A10driver moveindriver MyA10
_a10driver setdammage 0
~.5
_a10driver action ["Eject", MyA10]
mya10 setdammage .99
~2
you must fix the A10 for a short time so the pilot can get back in for the ejection but you could try
myA10 setdammage 0
You will probably have to fiddle around with the timing and the placements to get the effect just right.....I know I did
hope some of this helps
if you don't understand just ask ;D
Tenchu