I've posted the whole thing so you can see. What I need to do is make it so that the script can only be called three times. I don't want
Airstrike 1
Airstrike 2
Airstrike 3
in my radio messages list. Any ideas?
;Airstrike (map click) v1.2
;by Skumball (simongoddard4@yahoo.co.uk)
;Modified by The-Architect (The_arch@hotmail.com)
;Needs listed sounds to work with audio
;
;Thanks to Viriato for making the bombs fall correctly and LCD for incorporating the script into the radio
;
;Requires:
;OFP v1.85
;1 Pilot named "strikePilot"
;3 Markers ("spawn","safe","target" all set to 'empty')
;1 Trigger (Activation: Radio Alpha, Repeatedly. Text: Air Strike. On Activation: onMapSingleClick {[_pos] exec "airstrike.sqs"}; strikePilot sideChat "Give me a target.")
;
;Have a look at the sample mission to see how it works
;Change the value of _num, *0.2 and ~0.2 for different results
onMapSingleClick {}
1 setRadioMsg "Null"
_pos = _this select 0
"target" setMarkerPos _pos
"target" setMarkerType "destroy"
strikePlane = "ITA_TRD_RAF_BHD14_KEY" camCreate (getMarkerPos "spawn")
strikePlane setPos [(getPos strikePlane select 0),(getPos strikePlane select 1),(getPos strikePlane select 2)+800]
strikePlane setDir 180
strikeplane flyinheight 75
strikePilot assignAsDriver strikePlane
strikePilot moveInDriver strikePlane
strikePilot doMove _pos
strikePilot sideChat "Roger. On the way."
playsound "onway"
@ unitReady strikePilot
strikePilot sideChat "Bombs gone."
playsound "gone"
_num = 4
_i = 0
#loop
_bomb = "ITA_Mk82HD_RAF" camCreate [(getPos strikePlane select 0)+((random 10)-5),(getPos strikePlane select 1)+((random 10)-5),(getPos strikePlane select 2)-3]
_bomb setDir (getDir strikePlane)
_bomb setVelocity [(velocity strikePlane select 0)*0.1,(velocity strikePlane select 1)*0.1,(velocity strikePlane select 2)*0.1]
_i = _i + 1
~0.15
? _i < _num : goto "loop"
strikePilot doMove (getMarkerPos "spawn")
~3
strikePilot sideChat "Heading back. Over."
playsound "heading"
"target" setMarkerType "empty"
@ unitReady strikePilot
deleteVehicle strikePlane
strikePilot setVelocity [0,0,0]
strikePilot setPos (getMarkerPos "safe")
strikePilot sideChat "I'm ready for another run. Over."
playsound "run"
1 setRadioMsg "Air Strike"
exit