Jump to content
Sign in to follow this  
Chunk3ym4n

How to make an airplane drop it's bombs?

Recommended Posts

This is for A10

this fire "BombLauncherA10";

put that code in waypoint init field. However this is pretty simple and can not work every time.

Here is full script:

;Note: You have to put an empty Heli-H on the map called "ASTarget", and you have to place a //marker called "Firedirection". 
;If you want the Airstrike to hit a fixed position, just delete the 
;setfire-part and put the "ASTarget" on the position that you want to hit. Hope it works...
_player = player;
setfire=true;
titleText ["Click on map to send coordinates","plain down"];
onMapSingleClick "ASTarget setPos _pos; setfire=false";
@!setfire;
"Firedirection" setmarkerpos getPos ASTarget;
onMapSingleClick "";
titleText ["", "plain down"];
;=========DEFINE=======================
_dropPosition = getpos ASTARGET;
~0.1
_dropPosX = _dropPosition select 0;
_dropPosY = _dropPosition select 1;
_dropPosZ = _dropPosition select 2;
~0.1
;Aircraft1
_planespawnpos = [_dropPosX -3000, _dropPosY, _dropPosZ + 200];
_pilotspawnpos = [_dropPosX -3000, _dropPosY, _dropPosZ + 200];
~1.1
;Aircraft2
_planespawnpos2 = [_dropPosX -3000, _dropPosY, _dropPosZ + 230];
_pilotspawnpos2 = [_dropPosX -3000, _dropPosY, _dropPosZ + 230];
;=========CREATE=======================
_PlaneG = creategroup WEST;
_PlaneG2 = creategroup WEST;
~0.1
_plane = createVehicle ["A10",_planespawnpos,[], 0, "FLY"];
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),200];
_pilot = "USMC_Soldier_Pilot" createUnit [getMarkerPos "Firedirection", _PlaneG, "P1=this"];
_plane setDir (getdir _player);
_Plane setVelocity [220,0,0];
_PlaneG = [_plane,1] execvm "CA\Data\ParticleEffects\SCRIPTS\misc\aircraftvapour.sqf";
~0.5
_plane2 = createVehicle ["A10",_planespawnpos2,[], 0, "FLY"];
_plane2 setPos [(getPos _plane2 select 0),(getPos _plane2 select 1),230];
_pilot2 = "USMC_Soldier_Pilot" createUnit [getMarkerPos "Firedirection", _PlaneG2, "P2=this"];
_plane2 setDir (getdir _player);
_Plane2 setVelocity [220,0,0];
_PlaneG2 = [_plane2,1] execvm "CA\Data\ParticleEffects\SCRIPTS\misc\aircraftvapour.sqf";
~0.1
;Aircraft1
P1 moveinDriver _plane;
P1 setDamage 0;
P1 action ["gear_up", vehicle P1];
_plane setSpeedMode "FULL";
p1 setBehaviour "RED";
;Aircraft2
P2 moveinDriver _plane2;
P2 setDamage 0;
P2 action ["gear_up", vehicle P2];
_plane2 setSpeedMode "FULL";
p2 setBehaviour "RED";
~1
#CHECK
;hintsilent "Strafing with 30mm Anti-Personnel";
;Aircraft1
_plane setVehicleAmmo 1;
_plane fire "Gau8";
;Aircraft2
_plane2 setVehicleAmmo 1;
_plane2 fire "Gau8";
;Aircraft1
_plane flyinheight 140;
P1 doMove getPos ASTarget;
P1 doTarget ASTarget;
P1 doWatch ASTarget;
P1 setBehaviour "RED";
? (_plane distance ASTarget) < 1300 : goto "DROP"
;Aircraft2
_plane2 flyinheight 140;
P2 doMove getPos ASTarget;
P2 doTarget ASTarget;
P2 doWatch ASTarget;
P2 setBehaviour "RED";
? (_plane2 distance ASTarget) < 1300 : goto "DROP"
goto "CHECK"
;=========FIRE=======================
#DROP
_i = 0
;Aircraft1
_plane flyinheight 100;
;Aircraft2
_plane2 flyinheight 100;
#FIRE
_i=_i+1
;Aircraft1
_plane setVehicleAmmo 1;
_plane fire "BombLauncherA10";
;Aircraft2
_plane2 setVehicleAmmo 1;
_plane2 fire "BombLauncherA10";
;hintsilent "Bombs Dropped";
~3
;Aircraft1
;p1 action ["useWeapon",vehicle _plane,driver vehicle p1,1];
;Aircraft2
;p2 action ["useWeapon",vehicle _plane2,driver vehicle p2,1];
? _i <= 6 : goto "FIRE"
;=========FLY AWAY=======================
ASTarget setPos [0,0,0];
"Firedirection" setMarkerPos [0,0];
;Aircraft1
_plane setSpeedMode "FULL";
;Aircraft2
_plane2 setSpeedMode "FULL";
~5
P1 doMove getPos ASTarget;
P2 doMove getPos ASTarget;
#Check2
;Aircraft1
_plane flyinheight 200;
;Aircraft2
_plane2 flyinheight 200;
;Aircraft1
_plane setDamage 0;
_plane setVehicleAmmo 1;
_Plane setFuel 1;
P1 setDamage 0;
? (_plane distance Player) > 2500 : goto "ENDE"
;Aircraft2
_plane2 setDamage 0;
_plane2 setVehicleAmmo 1;
_Plane2 setFuel 1;
P2 setDamage 0;
? (_plane2 distance Player) > 2500 : goto "ENDE"
goto "Check2"
;=========DELETE========================
#ENDE
hintSilent "'A10' is returning to base - over";
;Aircraft1
deleteVehicle _plane;
deleteGroup _PlaneG;
deleteVehicle P1;
;Aircraft2
deleteVehicle _plane2;
deleteGroup _PlaneG2;
deleteVehicle P2;
exitWith

USAGE Note:

You have to put an empty Heli-H on the map called "ASTarget", and you have to place a marker called "Firedirection".

If you want the Airstrike to hit a fixed position, just delete the

setfire-part and put the "ASTarget" on the position that you want to hit. Hope it works...

Edited by Dan86

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×