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:
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?
onMapSingleClick " ""airstrike1"" setMarkerPos _pos; onMapSingleClick "" ""airstrike2"" setMarkerPos _pos; onMapSingleClick "" "";Defini = true; true""; true;";
Thanks in advance.
SPhoenix