Jump to content
Sign in to follow this  
sphoenix

Napalm Air Support

Recommended Posts

Hi everybody!

I'm currently making a PvP mission in which a side has the opportunity to launch a Napalm air strike, using a script I found on ArmAholic.

To that purpose I made a script where the leader has to click twice on the map to define the direction of the strike.

Here's the script:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hintC "Cliquez sur la carte deux fois pour definir la frappe aerienne";

onMapSingleClick " ""airstrike1"" setMarkerPos _pos; onMapSingleClick "" ""airstrike2"" setMarkerPos _pos; onMapSingleClick "" "";Defini = true; true""; true;";

hint "Frappe aerienne en cours.";

waitUntil {Defini == true};

_dir = acos ( ((getMarkerPos "airstrike2" select 0) - (getMarkerPos "airstrike1" select 0))/sqrt( ((getMarkerPos "airstrike2" select 1)-(getMarkerPos "airstrike1" select 1))^2 + ((getMarkerPos "airstrike2" select 0) - (getMarkerPos "airstrike1" select 0))^2));

Plane setPos [(getMarkerPos "airstrike1" select 0) - 1000*(sin _dir),(getMarkerPos "airstrike1" select 1) - 1000*(cos _dir),200];

Plane setDir _dir

Plane move getMarkerPos "airstrike1";

Plane setVelocity [100*(sin _dir),100*(cos _dir),100]

Plane flyInHeight 200

Bidon1 = "Barrel1" createVehicle getMarkerPos "airstrike1";

Bidon2 = "Barrel2" createVehicle [(getMarkerPos "airstrike1" select 0) + 2*(sin _dir),(getMarkerPos "airstrike1" select 1) + 2*(cos _dir),0];

Bidon3 = "Barrel3" createVehicle [(getMarkerPos "airstrike1" select 0) + 4*(sin _dir),(getMarkerPos "airstrike1" select 1) + 4*(cos _dir),0];

Bidon4 = "Barrel4" createVehicle [(getMarkerPos "airstrike1" select 0) + 6*(sin _dir),(getMarkerPos "airstrike1" select 1) + 6*(cos _dir),0];

waitUntil {(Plane distance Bidon1) < 100};

~10

Bidon1 setPos [(getPos Bidon1 select 0),(getPos Bidon1 select 1),(getPos Bidon1 select 2) +14200]; nil = [Bidon1] execVM "Napalm\Napalm.sqf";

Bidon2 setPos [(getPos Bidon2 select 0),(getPos Bidon2 select 1),(getPos Bidon2 select 2) +14200]; nil = [Bidon2] execVM "Napalm\Napalm.sqf";

Bidon3 setPos [(getPos Bidon3 select 0),(getPos Bidon3 select 1),(getPos Bidon3 select 2) +14200]; nil = [Bidon3] execVM "Napalm\Napalm.sqf";

Bidon4 setPos [(getPos Bidon4 select 0),(getPos Bidon4 select 1),(getPos Bidon4 select 2) +14200]; nil = [Bidon4] execVM "Napalm\Napalm.sqf";

However the part with the onMapSingleClick won't work.

It wouldn't accept it.

Any ideas?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onMapSingleClick " ""airstrike1"" setMarkerPos _pos; onMapSingleClick "" ""airstrike2"" setMarkerPos _pos; onMapSingleClick "" "";Defini = true; true""; true;";

Thanks in advance.

SPhoenix

Share this post


Link to post
Share on other sites

You can also use single quotes inside of double quotes.

Try:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onMapSingleClick " 'airstrike1' setMarkerPos _pos; onMapSingleClick "" 'airstrike2' setMarkerPos _pos; onMapSingleClick ' '; Defini = true; true""; true;";

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  

×