diff --git a/source/INIT.sqf b/source/INIT.sqf
index 89d542e..b4599ef 100644
--- a/source/INIT.sqf
+++ b/source/INIT.sqf
@@ -152,16 +152,16 @@ else /// JIP for the client
if (isNil "Array_of_FOBname") then {
Array_of_FOBname = [];
};
-
+
+game_master = ["player1"];
player allowDamage false;
#include "dialog\supports_init.hpp"
#include "dialog\squad_number_init.hpp"
execVM "misc\gps_marker.sqf";
-if (!isMultiplayer) then {
- getsize_script = [player] execVM "mapsize.sqf";
-};
+
+getsize_script = [player] execVM "mapsize.sqf";
// IF MP
if (isMultiplayer) then {
@@ -221,29 +221,37 @@ if (isMultiplayer) then {
"finishedMissionsNumber" addPublicVariableEventHandler {[] execVM "persistent\persistent_stats_missions_total.sqf";}; // change the shown CP for request dialog
};
- if (isServer) then { // SERVER INIT
+ sleep 5;
+
+ if (((vehiclevarname player) in game_master)) then {
DUWS_host_start = false;
publicVariable "DUWS_host_start";
waitUntil {time > 0.1};
- getsize_script = [player] execVM "mapsize.sqf";
DUWS_host_start = true;
publicVariable "DUWS_host_start";
-
- // init High Command
- _handle = [] execVM "dialog\hc_init.sqf";
waitUntil {scriptDone getsize_script};
};
};
-if (isServer) then {
- _null = [] execVM "dialog\startup\hq_placement\placement.sqf";
- waitUntil {chosen_hq_placement};
+_null = [] execVM "dialog\startup\hq_placement\placement.sqf";
+waitUntil {chosen_hq_placement};
- // create random HQ
- if (!hq_manually_placed && !player_is_choosing_hqpos) then {
- hq_create = [20, 0.015] execVM "initHQ\locatorHQ.sqf";
- waitUntil {scriptDone hq_create};
- };
+// create random HQ
+if (!hq_manually_placed && !player_is_choosing_hqpos) then {
+ hq_create = [20, 0.015] execVM "initHQ\locatorHQ.sqf";
+ waitUntil {scriptDone hq_create};
+};
+
+if (hasinterface) then {
+ _grplogic = createGroup sideLogic;
+ _hc_module = _grplogic createUnit ["HighCommand",[0,0,0] , [], 0, ""];
+ _hc_module synchronizeObjectsAdd [game_master];
+ // done,
+
+ // make 1 HC subordinate so that the player will not control all blufor forces
+ _grplogic = createGroup sideLogic;
+ _sub_module = _grplogic createUnit ["HighCommandsubordinate",[0,0,0] , [], 0, ""];
+ _sub_module synchronizeObjectsAdd [_hc_module];
};
/*
@@ -286,16 +294,10 @@ if (!isServer) then {
player setdamage 0;
player allowDamage true;
hintsilent format["Joined game, welcome to %1, %2",worldName,profileName];
-
- // init High Command
- _handle = [] execVM "dialog\hc_init.sqf";
+
[] execVM "dialog\startup\weather_client.sqf";
};
-if (!isMultiplayer) then {
- _handle = [] execVM "dialog\hc_init.sqf";
-};
-
if (isServer) then {
// initialise the ressources per zone bonus
_basepoint = [] execVM "zonesundercontrol.sqf";
diff --git a/source/dialog/UAV1.sqf b/source/dialog/UAV1.sqf
new file mode 100644
index 0000000..ac095bf
--- /dev/null
+++ b/source/dialog/UAV1.sqf
@@ -0,0 +1,11 @@
+_pos = getpos player;
+
+_plane1 = createVehicle ["B_UAV_02_F", _pos,[], 0, "FLY"];
+_plane1 setpos [_pos select 0, _pos select 1, (_pos select 2) + 1000];
+_planegroup1 = createvehiclecrew _plane1;
+
+sleep 2;
+
+_wp1 = _planegroup1 addWaypoint [_pos,0];
+_wp1 setWaypointType "GUARD";
+[_planegroup1, 1] setWaypointCombatMode "BLUE";
\ No newline at end of file
diff --git a/source/dialog/UAV2.sqf b/source/dialog/UAV2.sqf
new file mode 100644
index 0000000..ad9c7b6
--- /dev/null
+++ b/source/dialog/UAV2.sqf
@@ -0,0 +1,11 @@
+_pos = getpos player;
+
+_plane1 = createVehicle ["B_UAV_02_CAS_F", _pos,[], 0, "FLY"];
+_plane1 setpos [_pos select 0, _pos select 1, (_pos select 2) + 1000];
+_planegroup1 = createvehiclecrew _plane1;
+
+sleep 2;
+
+_wp1 = _planegroup1 addWaypoint [_pos,0];
+_wp1 setWaypointType "GUARD";
+[_planegroup1, 1] setWaypointCombatMode "BLUE";
\ No newline at end of file
diff --git a/source/dialog/UAV3.sqf b/source/dialog/UAV3.sqf
new file mode 100644
index 0000000..f696de8
--- /dev/null
+++ b/source/dialog/UAV3.sqf
@@ -0,0 +1,11 @@
+_pos = getpos player;
+
+_plane1 = createVehicle ["B_UAV_01_F", _pos,[], 0, "FLY"];
+_plane1 setpos [_pos select 0, _pos select 1, (_pos select 2) + 1000];
+_planegroup1 = createvehiclecrew _plane1;
+
+sleep 2;
+
+_wp1 = _planegroup1 addWaypoint [_pos,0];
+_wp1 setWaypointType "GUARD";
+[_planegroup1, 1] setWaypointCombatMode "BLUE";
\ No newline at end of file
diff --git a/source/dialog/casspawn.sqf b/source/dialog/casspawn.sqf
new file mode 100644
index 0000000..c159146
--- /dev/null
+++ b/source/dialog/casspawn.sqf
@@ -0,0 +1,35 @@
+_pos = getpos player;
+
+_plane = createVehicle ["B_Plane_CAS_01_F", _pos,[], 0, "FLY"];
+_plane setpos [_pos select 0, _pos select 1, (_pos select 2) + 1000];
+_planegroup = createGroup west;
+
+_pilot = _planegroup createUnit ["B_Pilot_F", [5,5,5], [], 0, "NONE"];
+_pilot setcaptive true;
+_pilot allowfleeing 0;
+_pilot disableAI "Target";
+_pilot moveindriver _plane;
+_plane land "LAND";
+
+waituntil {(istouchingground _plane)};
+_plane engineOn false;
+_plane setFuel 0;
+
+waitUntil {(speed _plane) <= 0};
+_plane setDamage 0;
+deletevehicle _pilot;
+_plane setfuel 1;
+
+waitUntil {(speed _plane) <= 0};
+if (!alive _plane) then {hint "Your A-164 CAS has crashed"} else {
+ _pos2 = getPos _plane;
+ _marker = format["plane",_pos2]; // Define marker name
+ _markerstr = createMarker [str(_marker), _pos2];
+ _markerstr setMarkerShape "ICON";
+ str(_marker) setMarkerType "hd_end";
+ str(_marker) setMarkerColor "ColorGreen";
+ str(_marker) setMarkerText "A-164 CAS Lands Here";
+};
+
+waituntil {(speed _plane) > 0};
+deleteMarker str(_marker);
\ No newline at end of file
diff --git a/source/dialog/request.sqf b/source/dialog/request.sqf
index da5f984..04b62c8 100644
--- a/source/dialog/request.sqf
+++ b/source/dialog/request.sqf
@@ -60,7 +60,7 @@ _index1 = lbAdd [2102, "SF SUV(2CP)"]; // 19
_index1 = lbAdd [2102, "MLRS Artillary (75CP)"]; // 20
_index1 = lbAdd [2102, "Scorcher Artillary (75CP)"]; // 21
_index1 = lbAdd [2102, "Fuel Truck (10CP)"]; // 22
-_index1 = lbAdd [2102, "BUY ONLY AT AIRPORTS A-164 CAS(45CP)"]; // 23
+_index1 = lbAdd [2102, "A-164 CAS(45CP)"]; // 23
_index1 = lbAdd [2102, "M2A4 SlammerUP(40CP)"]; // 24
_index1 = lbAdd [2102, "Stomper RCWS Autonomous(20CP)"]; // 25
_index1 = lbAdd [2102, "Stomper Autonomous Recon(10CP)"]; // 26
diff --git a/source/dialog/request_vehicle.sqf b/source/dialog/request_vehicle.sqf
index 5849981..e67e9f2 100644
--- a/source/dialog/request_vehicle.sqf
+++ b/source/dialog/request_vehicle.sqf
@@ -254,7 +254,7 @@ switch (_index) do {
hint "Vehicle ready !";
commandpointsblu1 = commandpointsblu1 - 45;
ctrlSetText [1000, format["%1",commandpointsblu1]];
- _vehic = "B_Plane_CAS_01_F" createVehicle _spawnPos;
+ _vehic = execVM "dialog\casspawn.sqf";
} else {
hint "Not enough command points";
};
@@ -294,7 +294,7 @@ switch (_index) do {
hint "Vehicle ready !";
commandpointsblu1 = commandpointsblu1 - 15;
ctrlSetText [1000, format["%1",commandpointsblu1]];
- _vehic = "B_UAV_02_F" createVehicle _spawnPos; createVehicleCrew _vehic;
+ _vehic = execVM "dialog\UAV1.sqf";
} else {
hint "Not enough command points";
};
@@ -304,7 +304,7 @@ switch (_index) do {
hint "Vehicle ready !";
commandpointsblu1 = commandpointsblu1 - 15;
ctrlSetText [1000, format["%1",commandpointsblu1]];
- _vehic = "B_UAV_02_CAS_F" createVehicle _spawnPos; createVehicleCrew _vehic;
+ _vehic = execVM "dialog\UAV2.sqf";
} else {
hint "Not enough command points";
};
@@ -314,7 +314,7 @@ switch (_index) do {
hint "Vehicle ready !";
commandpointsblu1 = commandpointsblu1 - 5;
ctrlSetText [1000, format["%1",commandpointsblu1]];
- _vehic = "B_UAV_01_F" createVehicle _spawnPos; createVehicleCrew _vehic;
+ _vehic = execVM "dialog\UAV3.sqf";
} else {
hint "Not enough command points";
};
diff --git a/source/initHQ/BluHQinit.sqf b/source/initHQ/BluHQinit.sqf
index 1aa7ea1..c2cd4c9 100644
--- a/source/initHQ/BluHQinit.sqf
+++ b/source/initHQ/BluHQinit.sqf
@@ -72,30 +72,24 @@ sleep 0.1;
HQ_pos_found_generated = true;
publicVariable "HQ_pos_found_generated";
-if (!zones_manually_placed) then {
-
- // SHOW THE STARTUP MENU
- if (!zones_created) then {
- sleep 0.1;
- _nill = [] execVM "dialog\startup\startup.sqf";
- waitUntil {chosen_settings}; // WAIT UNTIL THE PLAYER HAS CHOSEN THE SETTINGS
- };
-
- // WEATHER INIT
- if (dynamic_weather_enable) then {
- _weather_script = [] execVM "dialog\startup\weather.sqf";
- };
-
- // CALL ZONES GENERATION
- waitUntil {!isNil {getsize_script}}; // WAIT UNTIL THE MAPSIZE SCRIPT IS DONE
-
- // CHECK IF ZONES ARE PLACED...
- // If not execute locatorZonesV1.sqf if the user wants them randomly placed. V2 if the user wants to place zones.
- if (!zones_created && !manually_chosen) then {
- _zones_create = [50, 0.2] execVM "initZones\locatorZonesV1.sqf";
- } else {
- _zones_create = [50, 0.2] execVM "initZones\locatorZonesV2.sqf";
- };
+// SHOW THE STARTUP MENU
+if (!zones_created) then {
+ sleep 0.1;
+ _nill = [] execVM "dialog\startup\startup.sqf";
+ waitUntil {chosen_settings}; // WAIT UNTIL THE PLAYER HAS CHOSEN THE SETTINGS
+};
+
+// WEATHER INIT
+if (dynamic_weather_enable) then {
+ _weather_script = [] execVM "dialog\startup\weather.sqf";
+};
+
+// CHECK IF ZONES ARE PLACED...
+// If not execute locatorZonesV1.sqf if the user wants them randomly placed. V2 if the user wants to place zones.
+if (!zones_created && !manually_chosen) then {
+ _zones_create = [50, 0.2] execVM "initZones\locatorZonesV1.sqf";
+} else {
+ _zones_create = [50, 0.2] execVM "initZones\locatorZonesV2.sqf";
};
player allowDamage true;
diff --git a/source/initHQ/HQaddactions.sqf b/source/initHQ/HQaddactions.sqf
index 106f6ee..20eb6b5 100644
--- a/source/initHQ/HQaddactions.sqf
+++ b/source/initHQ/HQaddactions.sqf
@@ -4,6 +4,7 @@ _hq addaction ["Player stats","dialog\info\info.sqf", "",
_hq addaction ["Request units","dialog\request.sqf", "", 0, true, true, "", "_this == player"];
_hq addaction ["Squad manager","dialog\squad\squadmng.sqf", "", 0, true, true, "", "_this == player"];
_hq addaction ["FOB manager","dialog\fob\FOBmanageropen.sqf", "", 0, true, true, "", "_this == player"];
+_hq addaction ["Sell resource","support\sell.sqf", "", 0, true, true, "", "_this == player"];
if (isServer) then {
_hq addaction ["Rest (wait/save)","savegame.sqf", "", 0, true, true, "", "_this == player"];
};
diff --git a/source/initZones/locatorzonesV1.sqf b/source/initZones/locatorzonesV1.sqf
index 99c6e4c..d9b4388 100644
--- a/source/initZones/locatorzonesV1.sqf
+++ b/source/initZones/locatorzonesV1.sqf
@@ -52,7 +52,7 @@ while {!_found} do
_posDeMeilleurTruc = [center_of_map, 0,half_of_map,5,0,0.1,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos;
if (_posDeMeilleurTruc select 0 != 0 && _posDeMeilleurTruc select 1 != 0) then {_Posfound=true;};
};
- _playerDistance = _posDeMeilleurTruc distance player;
+ _playerDistance = _posDeMeilleurTruc distance hq_blu1;
diff --git a/source/mapsize.sqf b/source/mapsize.sqf
index a4fc71c..f5fad1f 100644
--- a/source/mapsize.sqf
+++ b/source/mapsize.sqf
@@ -1,11 +1,13 @@
_unit = _this select 0;
_debug = _this select 1;
+sleep 3;
+
private ["_grid_size"];
disableserialization;
openMap [true, false];
-WaitUntil {visibleMap};
+WaitUntil {(visibleMap)};
x_mapsize = 0;
y_mapsize = 0;
diff --git a/source/missions/missions/destroy/mission.sqf b/source/missions/missions/destroy/mission.sqf
index 373bc0a..abcf844 100644
--- a/source/missions/missions/destroy/mission.sqf
+++ b/source/missions/missions/destroy/mission.sqf
@@ -29,9 +29,7 @@ _tower setdamage 0.85;
_tower setVectorUp [0,0,1];
// TASK AND NOTIFICATION
-_taskhandle = player createSimpleTask ["taskDestroy"];
-_taskhandle setSimpleTaskDescription ["We have detected a large amount of enemy trasmissions coming from this area. This is probably caused by a radio tower used by the enemy forces on the island. Destroy the tower. Be sure to take some satchels, which you can find in the armory. Armory can be unlocked at the HQ.",_mission_name,""];
-_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));
+[west, "_taskhandle", ["taskDestroy.", "We have detected a large amount of enemy trasmissions coming from this area. This is probably caused by a radio tower used by the enemy forces on the island. Destroy the tower. Be sure to take some satchels, which you can find in the armory. Armory can be unlocked at the HQ.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate;
if (!ismultiplayer) then {
execVM "utilities\autoSave.sqf";
@@ -52,7 +50,7 @@ waitUntil {sleep 1; !alive _tower};
deleteMarker str(_markername2);
deleteMarker str(_markername);
-player removeSimpleTask _taskhandle;
+[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;
// Give cookies (bonus & notifications)
reward = (30 * cp_reward_multiplier);
diff --git a/source/missions/missions/pilot/mission.sqf b/source/missions/missions/pilot/mission.sqf
index 805541b..3ea4bc1 100644
--- a/source/missions/missions/pilot/mission.sqf
+++ b/source/missions/missions/pilot/mission.sqf
@@ -41,9 +41,7 @@ _pilot setcaptive true;
_pilot switchMove "acts_CrouchingIdleRifle01";
// TASK AND NOTIFICATION
-_taskhandle = player createSimpleTask ["taskPilot"];
-_taskhandle setSimpleTaskDescription ["One of our AH-99 helicopters has been downed somewhere around this area. We have reports that the pilot is still alive. You must find him and bring him back to base.",_mission_name,""];
-_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));
+[west, "_taskhandle", ["taskDestroy.", "One of our AH-99 helicopters has been downed somewhere around this area. We have reports that the pilot is still alive. You must find him and bring him back to base.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate;
if (!ismultiplayer) then {
execVM "utilities\autoSave.sqf";
@@ -59,7 +57,7 @@ if (!(alive _pilot)) exitWith {
deleteMarker str(_markername2);
deleteMarker str(_markername);
- player removeSimpleTask _taskhandle;
+ [["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;
["TaskFailed",["","The pilot is dead"]] call bis_fnc_showNotification;
};
@@ -76,7 +74,7 @@ if (!(alive _pilot)) exitWith {
deleteMarker str(_markername2);
deleteMarker str(_markername);
- player removeSimpleTask _taskhandle;
+ [["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;
["TaskFailed",["","The pilot is dead"]] call bis_fnc_showNotification;
};
@@ -84,7 +82,7 @@ if (!(alive _pilot)) exitWith {
deleteMarker str(_markername2);
deleteMarker str(_markername);
-player removeSimpleTask _taskhandle;
+[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;
sleep 1;
diff --git a/source/missions/missions/rescue/mission.sqf b/source/missions/missions/rescue/mission.sqf
index e7e2af2..3bb6cd2 100644
--- a/source/missions/missions/rescue/mission.sqf
+++ b/source/missions/missions/rescue/mission.sqf
@@ -38,9 +38,7 @@ _group = createGroup west;
// TASK AND NOTIFICATION
_VARtaskgeneratedName = format ["rescue%1%2",round(_MissionPos select 0),round(_Missionpos select 1)]; // generate variable name for task
-_taskhandle = player createSimpleTask ["taskRescue"];
-_taskhandle setSimpleTaskDescription ["One of our patrols has been ambushed and requires immediate assistance",_mission_name,""];
-_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));
+[west, "_taskhandle", ["taskDestroy.", "RECOVER THE TPH
Transport Helicopter
", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate;
if (!ismultiplayer) then {
execVM "utilities\autoSave.sqf";
diff --git a/source/missions/missions/rescue/success.sqf b/source/missions/missions/rescue/success.sqf
index 8cbd7a9..26ccb27 100644
--- a/source/missions/missions/rescue/success.sqf
+++ b/source/missions/missions/rescue/success.sqf
@@ -14,7 +14,7 @@ private "_task";
_taskgeneratedName = format ["rescue%1%2",round(_MissionPos select 0),round(_Missionpos select 1)]; // generate taskname/variable name
call compile format["_task = %1",_taskgeneratedname]; // recall variable and inject it into handle
-player removeSimpleTask _task;
+[["_task", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;
// IF SOLDIERS DEAD
if (!(alive _sol1) && !(alive _sol2) && !(alive _sol3)) exitWith {
diff --git a/source/missions/missions/sabotage/mission.sqf b/source/missions/missions/sabotage/mission.sqf
index 79d2fb7..8f9faf7 100644
--- a/source/missions/missions/sabotage/mission.sqf
+++ b/source/missions/missions/sabotage/mission.sqf
@@ -30,9 +30,7 @@ _tower addaction ["Sabotage", "missions\missions\sabotage\success.sqf",[_mission
// TASK AND NOTIFICATION
_VARtaskgeneratedName = format["tsksabot%1%2",round(_MissionPos select 0),round(_Missionpos select 1)]; // generate variable name for task
-_taskhandle = player createSimpleTask ["taskSabot"];
-_taskhandle setSimpleTaskDescription ["The enemy is using a power supply somewhere in this area. We need you to find it and sabotage it. It will allow us to have a bit of better intel on our enemies.",_mission_name,""];
-_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));
+[west, "_taskhandle", ["taskDestroy.", "The enemy is using a power supply somewhere in this area. We need you to find it, walk up to it and 'sabotage' it USING YOUR ACTION MENU (DO NOT DESTROY IT WITH WEAPONS!). It will allow us to have a bit of better intel on our enemies.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate;
if (!ismultiplayer) then {
execVM "utilities\autoSave.sqf";
diff --git a/source/missions/missions/sabotage/success.sqf b/source/missions/missions/sabotage/success.sqf
index 0953c1a..9094689 100644
--- a/source/missions/missions/sabotage/success.sqf
+++ b/source/missions/missions/sabotage/success.sqf
@@ -16,7 +16,7 @@ call compile format["_taskhandle = %1",_VARtaskgeneratedName]; // recall variabl
_object removeAction _action;
-player removeSimpleTask _taskhandle;
+[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;
deleteMarker str(_markername2);
deleteMarker str(_markername);
diff --git a/source/missions/missions/steal/mission.sqf b/source/missions/missions/steal/mission.sqf
index 1c8a57f..8ac959a 100644
--- a/source/missions/missions/steal/mission.sqf
+++ b/source/missions/missions/steal/mission.sqf
@@ -44,9 +44,7 @@ _box3 setdir 180;
// TASK AND NOTIFICATION
-_taskhandle = player createSimpleTask ["taskSteal"];
-_taskhandle setSimpleTaskDescription ["An enemy truck full of supplies has been spotted in the area. Find it and bring it back to the base in one piece.",_mission_name,""];
-_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));
+[west, "_taskhandle", ["taskDestroy.", "An enemy truck full of supplies has been spotted in the area. Find it and bring it back to the base in one piece.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate;
if (!ismultiplayer) then {
execVM "utilities\autoSave.sqf";
@@ -73,7 +71,7 @@ waitUntil {sleep 2; ((getdammage _truck1)>0.95 OR (_truck1 distance _initpos)<50
deleteMarker str(_markername2);
deleteMarker str(_markername);
-player removeSimpleTask _taskhandle;
+[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;
if (getdammage _truck1>0.95) exitWith {
["TaskFailed",["","The enemy convoy is destroyed"]] call bis_fnc_showNotification;
diff --git a/source/missions/missions/target/mission.sqf b/source/missions/missions/target/mission.sqf
index f874c65..5ba7b6d 100644
--- a/source/missions/missions/target/mission.sqf
+++ b/source/missions/missions/target/mission.sqf
@@ -38,9 +38,7 @@ _unit = _group createUnit ["O_soldier_F", _missionpos, [], 0, "FORM"];
_unit = _group createUnit ["O_soldier_F", _missionpos, [], 0, "FORM"];
// TASK AND NOTIFICATION
-_taskhandle = player createSimpleTask ["taskTarget"];
-_taskhandle setSimpleTaskDescription ["A high enemy target has been spotted somewhere in this location. Hunt him down.",_mission_name,""];
-_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));
+[west, "_taskhandle", ["taskDestroy.", "RECOVER THE TPH
Transport Helicopter
", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate;
if (!ismultiplayer) then {
execVM "utilities\autoSave.sqf";
@@ -54,7 +52,7 @@ waitUntil {sleep 2; !alive _target}; // MISSION COMPLETED --
deleteMarker str(_markername2);
deleteMarker str(_markername);
-player removeSimpleTask _taskhandle;
+[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;
sleep 1;
diff --git a/source/missions/missions/underwater/mission.sqf b/source/missions/missions/underwater/mission.sqf
index 4aefd4f..51a07f6 100644
--- a/source/missions/missions/underwater/mission.sqf
+++ b/source/missions/missions/underwater/mission.sqf
@@ -34,6 +34,8 @@ _taskhandle = player createSimpleTask ["taskSabot"];
_taskhandle setSimpleTaskDescription ["The enemy is using a power supply somewhere in this area. We need you to find it and sabotage it. It will allow us to have a bit of better intel on our enemies.",_mission_name,""];
_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));
+[west, "_taskhandle", ["taskSabot.", "The enemy is using a power supply somewhere in this area. We need you to find it and sabotage it. It will allow us to have a bit of better intel on our enemies.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate;
+
if (!ismultiplayer) then {
execVM "utilities\autoSave.sqf";
};
diff --git a/source/missions/missions/underwater/success.sqf b/source/missions/missions/underwater/success.sqf
index 5524921..255bf55 100644
--- a/source/missions/missions/underwater/success.sqf
+++ b/source/missions/missions/underwater/success.sqf
@@ -19,7 +19,8 @@ call compile format["_taskhandle = %1",_VARtaskgeneratedName];
_object removeAction _action;
-player removeSimpleTask _taskhandle;
++[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;
+
deleteMarker str(_markername2);
deleteMarker str(_markername);
diff --git a/source/missions/stratmap.sqf b/source/missions/stratmap.sqf
index 19d6fea..a28d19b 100644
--- a/source/missions/stratmap.sqf
+++ b/source/missions/stratmap.sqf
@@ -5,7 +5,7 @@ _counter = 0;
if (isnil ("Mission_timeout_request")) then {Mission_timeout_request = true;};
if (!Mission_timeout_request) exitWith {PAPABEAR=[West,"HQ"]; PAPABEAR SideChat "We don't have any other missions for you right now.";};
-if (!isServer) exitWith {hint "Only the host can request side missions for now"};
+if (!((getPlayerUID player) in ["ENTER UID HERE QUOTES INCLUDED"])) exitWith {hint "Only the host can request side missions for now"};
startLoadingScreen ["Loading zones..."];
_kibot_pos_array_missionPos = [[-99999,-99999,-99999]];
diff --git a/source/support/sell.sqf b/source/support/sell.sqf
new file mode 100644
index 0000000..33bc48c
--- /dev/null
+++ b/source/support/sell.sqf
@@ -0,0 +1,462 @@
+sell = {
+ _veh = vehicle player;
+ removeallactions _veh;
+ _undoaction = false;
+ _veh addAction ["Cancel transaction", {_null = [] call undo; _undoaction = true;}, "", 0, true, true, "", "vehicle _this == _target"];
+
+ hint "Get out of vehicle to complete transaction or cancel by selecting the new action.";
+
+ waituntil {_undoaction || (vehicle player != _veh)};
+
+ if (_undoaction) then {
+ _undoaction = false;
+ _null = [] call undo;
+ } else {
+ if (_veh iskindof "O_MRAP_02_hmg_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 9 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 9;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 18 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 18;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+
+ if (_veh iskindof "B_MRAP_01_hmg_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 9 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 9;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 18 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 18;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+
+ if (_veh iskindof "B_MRAP_01_gmg_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 14 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 14;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 25 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 25;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+
+ if (_veh iskindof "B_APC_Wheeled_01_cannon_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 17 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 17;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 35 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 35;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+
+ if (_veh iskindof "O_Heli_Attack_02_black_F") then {
+ _configEngineName = getText (configfile >> "CfgVehicles" >> typeOf _veh >> "HitPoints" >> "HitEngine" >> "name");
+ if (_veh gethit _configEngineName > 0.7) then {
+ hint "Engine damaged. Adding 22 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 22;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 45 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 45;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+
+ if (_veh iskindof "B_Heli_Light_01_armed_F") then {
+ _configEngineName = getText (configfile >> "CfgVehicles" >> typeOf _veh >> "HitPoints" >> "HitEngine" >> "name");
+ if (_veh gethit _configEngineName > 0.7) then {
+ hint "Engine damaged. Adding 17 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 17;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 35 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 35;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_Heli_Attack_01_F") then {
+ _configEngineName = getText (configfile >> "CfgVehicles" >> typeOf _veh >> "HitPoints" >> "HitEngine" >> "name");
+ if (_veh gethit _configEngineName > 0.7) then {
+ hint "Engine damaged. Adding 22 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 22;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 45 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 45;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_Heli_Light_01_F") then {
+ _configEngineName = getText (configfile >> "CfgVehicles" >> typeOf _veh >> "HitPoints" >> "HitEngine" >> "name");
+ if (_veh gethit _configEngineName > 0.7) then {
+ hint "Engine damaged. Adding 7.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 7.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 15 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 15;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_Heli_Transport_01_F") then {
+ _configEngineName = getText (configfile >> "CfgVehicles" >> typeOf _veh >> "HitPoints" >> "HitEngine" >> "name");
+ if (_veh gethit _configEngineName > 0.7) then {
+ hint "Engine damaged. Adding 11 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 11;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 22 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 22;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_APC_Tracked_01_rcws_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 17.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 17.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 35 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 35;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_Quadbike_01_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding .5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + .5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 1 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 1;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_APC_Tracked_01_AA_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 15 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 15;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 30 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 30;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_MBT_01_cannon_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 27.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 27.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 55 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 55;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_APC_Tracked_01_CRV_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 14 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 14;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 28 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 28;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "C_Offroad_01_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 1 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 1;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 2 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 2;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_MBT_01_mlrs_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 37.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 37.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 75 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 75;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_MBT_01_arty_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 37.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 37.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 75 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 75;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_G_Van_01_fuel_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 10 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 10;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_MBT_01_TUSK_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 20 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 20;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 40 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 40;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_UGV_01_rcws_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 10 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 10;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 20 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 20;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_UGV_01_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 10 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 10;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_Plane_CAS_01_F") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 22.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 22.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 45 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 45;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "kyo_MH47E_Ramp") then {
+ _configEngineName = getText (configfile >> "CfgVehicles" >> typeOf _veh >> "HitPoints" >> "HitEngine" >> "name");
+ if (_veh gethit _configEngineName > 0.7) then {
+ hint "Engine damaged. Adding 22.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 22.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 45 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 45;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "USAF_CV22") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 22.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 22.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 45 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 45;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "B_UCSV_02") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 0 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 0;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 0 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 0;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "O_Heli_Transport_04_F") then {
+ _configEngineName = getText (configfile >> "CfgVehicles" >> typeOf _veh >> "HitPoints" >> "HitEngine" >> "name");
+ if (_veh gethit _configEngineName > 0.7) then {
+ hint "Engine damaged. Adding 12.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 12.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 25 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 25;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "BWA3_Puma_Fleck") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 22.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 22.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 45 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 45;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "BWA3_Leopard2A6M_Fleck") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 22.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 22.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 45 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 45;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "HMMWV_M1151_M2") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 10 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 10;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 20 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 20;
+ publicvariable "commandpointsblu1";
+ };
+ };
+
+ if (_veh iskindof "M1114_AGS_ACR") then {
+ if (_veh gethit "motor" > 0.7) then {
+ hint "Engine damaged. Adding 12.5 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 12.5;
+ publicvariable "commandpointsblu1";
+ } else {
+ hint "Vehicle is fine. Adding 25 CP";
+ deletevehicle _veh;
+ commandpointsblu1 = commandpointsblu1 + 25;
+ publicvariable "commandpointsblu1";
+ };
+ };
+ };
+};
+
+undo = {
+ hint "Get in another vehicle if you wish to sell it.";
+ waituntil {(vehicle player != player)};
+
+ _veh = vehicle player;
+ _veh addAction ["Sell this vehicle", {_null = [] call sell;}, "", 0, true, true, "", "vehicle _this == _target"];
+};
+
+hint "Enter the vehicle you wish to sell";
+
+waituntil {(vehicle player != player)};
+
+_veh = vehicle player;
+_veh addAction ["Sell this vehicle", {_null = [] call sell;}, "", 0, true, true, "", "vehicle _this == _target"];
\ No newline at end of file
diff --git a/source/support/taxi/helotaxi.sqf b/source/support/taxi/helotaxi.sqf
index df41583..4e45f3f 100644
--- a/source/support/taxi/helotaxi.sqf
+++ b/source/support/taxi/helotaxi.sqf
@@ -1,247 +1,395 @@
-_posplayer = _this select 0;
-_radius = _this select 1;
-_foundPickupPos = [];
-taxiCanTakeOff = false;
-
-_music = call compile preprocessFile "support\taxi\random_music.sqf";
-
-
-if (commandpointsblu1 < 1) exitWith {
- ["info",["Not enough command points","Not enough Command Points (1 CP required)"]] call bis_fnc_showNotification;
- sleep 15;
- _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
-};
-
-
-_foundPickupPos = [_posplayer, 0,_radius,10,0,0.2,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos; // find a valid pos
-
-// try to find a pos, if no pos is found exit the script
-if (0 == _foundPickupPos select 0 && 0 == _foundPickupPos select 1) exitWith {hint "No valid LZ nearby"; sleep 5; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;};
-
-
-
-// A POS NEAR THE PLAYER HAS BEEN FOUND, CHOOPA EN ROUTE
-commandpointsblu1 = commandpointsblu1 - 1;
-publicVariable "commandpointsblu1";
-
-// create marker on LZ
-_markerpickup = format["lz%1%2",_foundPickupPos]; // Define marker name
-_markerstr = createMarker [str(_markerpickup), _foundPickupPos];
-_markerstr setMarkerShape "ICON";
-str(_markerpickup) setMarkerType "hd_end";
-str(_markerpickup) setMarkerColor "ColorGreen";
-str(_markerpickup) setMarkerText "LZ";
-
-
-
-// create the chopper, gunners and pilots
-_helo = createVehicle ["B_Heli_Transport_01_camo_F", [_posplayer select 0, (_posplayer select 1)+2000, 200],[], 0, "FLY"];
-_helogroup = createGroup west;
-_pilot = _helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"];
-_copilot = _helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"];
-_gunner1 = _helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"];
-_gunner2 = _helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"];
-_helo flyInHeight 100;
-_helo addAction ["Give a LZ to the pilot", "support\taxi\mapclickhelo.sqf", "", 0, true, true, "", "vehicle _this == _target"];
-
-_pilot setcaptive true;
-
-_pilot moveindriver _helo;
-_copilot moveInTurret [_helo, [0]];
-_gunner1 moveInTurret [_helo, [1]];
-_gunner2 moveInTurret [_helo, [2]];
-
-
-// create the helipad to land and the waypoints
-_helipad1 = createVehicle ["Land_HelipadEmpty_F", _foundPickupPos, [], 0, "NONE"];
-_wp = _helogroup addWaypoint [[_foundPickupPos select 0, (_foundPickupPos select 1)-75], 0];
-_wp setWaypointType "MOVE";
-[_helogroup, 1] setWaypointCombatMode "BLUE";
-
-_fobname = [1] call compile preprocessFile "random_name.sqf";
-_random1 = round random 9;
-_random2 = round random 9;
-
-
-
-_pilot sideChat format["This is %1 %2-%3, we're approaching your location for pick up, check your map for the LZ",_fobname,_random1,_random2];
-
-
-waitUntil {_foundpickuppos distance _helo < 350 or (vehicle _pilot == _pilot or !alive _pilot)}; // wait until the helo is near the lz
-_pilot setcaptive false;
-// IF THE PILOT IS DEAD OR CHOPPA DOWN ******************
-if (vehicle _pilot == _pilot or !alive _pilot) exitWith {
-deleteVehicle _helipad1;
-deleteMarker str(_markerpickup);
-hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
-// --- AJOUTER DE NOUVEAU LE SUPPORT
-sleep 15;
-_art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
-};
-// ****************************************************
-
-// spawn smokeshell
-_smokePos = [_foundpickuppos select 0, (_foundpickuppos select 1)+ random 5];
-_smoke = "SmokeShellGreen" createVehicle _smokePos;
-_chemlight = "Chemlight_green" createVehicle _smokePos;
-
-_helo land "LAND";
-
-// spawn the door opening script
-_pickupSpawnopen = [_helo,_foundpickuppos] spawn {
-_helo = _this select 0;
-_lzPos = _this select 1;
-waitUntil {getpos _helo distance _lzPos < 10};
-_helo animateDoor ['door_R', 1];
-sleep 3;
-_helo animateDoor ['door_L', 1];
-};
-
-_inVehCheck = true;
-while {_inVehCheck} do {
-waitUntil {sleep 0.1;taxiCanTakeOff or (vehicle _pilot == _pilot or !alive _pilot)}; // wait until the player has given a validpos
-if (vehicle _pilot == _pilot or !alive _pilot) exitWith {}; // get out of the loop if choopa is down
-// check if player is inside choppa
-if (vehicle player != _helo) then {taxiCanTakeOff = false; _pilot sidechat format["This is %1 %2-%3, get back in, I can't transport you're not inside the chopper !",_fobname,_random1,_random2]; _helo addAction ["Give a LZ to the pilot", "support\taxi\mapclickhelo.sqf", "", 0, true, true, "", "vehicle _this == _target"];} else {_inVehCheck = false;};
-};
-
-// IF THE PILOT IS DEAD OR CHOPPA DOWN **************
-if (vehicle _pilot == _pilot or !alive _pilot) exitWith {
-deleteVehicle _helipad1;
-deleteMarker str(_markerpickup);
-hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
-sleep 15;
-_art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
-// --- AJOUTER DE NOUVEAU LE SUPPORT
-};
-// *****************************
-
-
-// everything is ok, player is in choppa
-playMusic [_music, 0];
-//_helo lock true;
-titleText ["Pilot: Roger that, we're oscar mike...", "PLAIN DOWN"];
-str(_markerpickup) setMarkerPos ClickedTaxiPos;
-
-// create the helipad to land and the waypoints
-_helipad = createVehicle ["Land_HelipadEmpty_F", ClickedTaxiPos, [], 0, "NONE"];
-_wp = _helogroup addWaypoint [ClickedTaxiPos,0];
-_wp setWaypointType "MOVE";
-[_helogroup, 1] setWaypointCombatMode "BLUE";
-
-// spawn the door closing script
-_pickupSpawnclose = [_helo,_foundpickuppos] spawn {
-_helo = _this select 0;
-_lzPos = _this select 1;
-waitUntil {getpos _helo distance _lzPos > 10};
-_helo animateDoor ['door_R', 0];
-sleep 3;
-_helo animateDoor ['door_L', 0];
-};
-
-waitUntil {sleep 0.5;_helo distance _helipad1 > 350 or (vehicle _pilot == _pilot or !alive _pilot)}; // wait until the helo is away from LZ
-// IF THE PILOT IS DEAD OR CHOPPA DOWN **************
-if (vehicle _pilot == _pilot or !alive _pilot) exitWith {
-deleteVehicle _helipad1;
-deleteVehicle _helipad;
-_helo lock false;
-deleteMarker str(_markerpickup);
-hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
-// --- AJOUTER DE NOUVEAU LE SUPPORT
-sleep 15;
-_art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
-};
-// *****************************
-if (enableChopperFastTravel) then {
-// TELEPORT HELO NEAR LZ
-deleteVehicle _helipad1;
-titleText ["En route to LZ...", "BLACK OUT", 3];
-sleep 3.5;
-_helo setpos [getpos _helipad select 0, (getpos _helipad select 1)+1000, 150];
-sleep 3;
-titleText ["En route to LZ...", "BLACK IN", 4];
-};
-
-waitUntil {ClickedTaxiPos distance _helo < 200 or (vehicle _pilot == _pilot or !alive _pilot)}; // wait until the helo is near the lz
-// IF THE PILOT IS DEAD OR CHOPPA DOWN **************
-if (vehicle _pilot == _pilot or !alive _pilot) exitWith {
-deleteVehicle _helipad;
-_helo lock false;
-deleteMarker str(_markerpickup);
-hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
-// --- AJOUTER DE NOUVEAU LE SUPPORT
-sleep 15;
-_art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
-};
-// *****************************
-_helo land "LAND";
-
-// spawn the door opening script
-_LzSpawnopen = [_helo] spawn {
-_helo = _this select 0;
-waitUntil {getpos _helo distance ClickedTaxiPos < 20};
-_helo animateDoor ['door_R', 1];
-sleep 3;
-_helo animateDoor ['door_L', 1];
-};
-
-
-// time to move ppl out of the helo;
-waitUntil {(getpos _helo select 2 < 4 && _helo distance _helipad<20) or (vehicle _pilot == _pilot or !alive _pilot)}; // wait until the helo is near the ground
-// IF THE PILOT IS DEAD OR CHOPPA DOWN **************
-if (vehicle _pilot == _pilot or !alive _pilot) exitWith {
-deleteVehicle _helipad;
-_helo lock false;
-hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
-// --- AJOUTER DE NOUVEAU LE SUPPORT
-sleep 15;
-_art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
-};
-// *****************************
-titleText ["Pilot: We've arrived at the LZ", "PLAIN DOWN"];
-_helo lock false;
-{doGetOut _x; sleep 1;} forEach units group player;
-
-sleep 20;
-_wp = _helogroup addWaypoint [[0,0,0],0]; // tell the helo to leave
-_wp setWaypointType "MOVE";
-deleteMarker str(_markerpickup);
-deleteVehicle _helipad;
-
-// spawn the door opening script
-_LzSpawnclose = [_helo] spawn {
-_helo = _this select 0;
-sleep 2;
-_helo animateDoor ['door_R', 0];
-sleep 3;
-_helo animateDoor ['door_L', 0];
-};
-
-
-
-waitUntil {_helo distance player>100 or (vehicle _pilot == _pilot or !alive _pilot)}; // wait until the helo is near the ground
-// IF THE PILOT IS DEAD OR CHOPPA DOWN **************
-if (vehicle _pilot == _pilot or !alive _pilot) exitWith {
-hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
-// --- AJOUTER DE NOUVEAU LE SUPPORT
-sleep 15;
-_art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
-};
-// *****************************
-_pilot sideChat format["This is %1 %2-%3, we are RTB",_fobname,_random1,_random2];
-
-sleep 200;
-
-terminate _pickupSpawnopen;
-terminate _pickupSpawnclose;
-terminate _LzSpawnopen;
-terminate _LzSpawnclose;
-
-deleteVehicle _pilot;
-deleteVehicle _copilot;
-deleteVehicle _gunner1;
-deleteVehicle _gunner2;
-deleteVehicle _helo;
-
-sleep 2;
-_art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
+calltaxi = {
+ helo setfuel 1;
+
+ _foundPickupPos = [getpos player, 0,50,10,0,0.2,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos; // find a valid pos
+
+ // try to find a pos, if no pos is found exit the script
+ if (0 == _foundPickupPos select 0 && 0 == _foundPickupPos select 1) exitWith {hint "No valid LZ nearby"; sleep 5; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;};
+
+ // create marker on LZ
+ markerpickup = format["lz%1%2", _foundPickupPos]; // Define marker name
+ _markerstr = createMarker [str(markerpickup), _foundPickupPos];
+ _markerstr setMarkerShape "ICON";
+ str(markerpickup) setMarkerType "hd_end";
+ str(markerpickup) setMarkerColor "ColorGreen";
+ str(markerpickup) setMarkerText "LZ";
+
+ // A POS NEAR THE PLAYER HAS BEEN FOUND, CHOOPA EN ROUTE
+ commandpointsblu1 = commandpointsblu1 - 1;
+ publicVariable "commandpointsblu1";
+
+ // create the helipad to land and the waypoints
+ helo setfuel 1;
+ helo engineon true;
+ helipad1 = createVehicle ["Land_HelipadEmpty_F", _foundPickupPos, [], 0, "NONE"];
+ _wp = helogroup addWaypoint [[_foundPickupPos select 0, (_foundPickupPos select 1)-75], 0];
+ _wp setWaypointType "MOVE";
+ [helogroup, 1] setWaypointCombatMode "BLUE";
+
+ _fobname = [1] call compile preprocessFile "random_name.sqf";
+ _random1 = round random 9;
+ _random2 = round random 9;
+
+ pilot sideChat format["This is %1 %2-%3, we are approaching your location for pick up, check your map for the LZ",_fobname,_random1,_random2];
+
+ waitUntil {_foundpickuppos distance helo < 350 or (getdammage helo > 0.7 or !alive pilot)}; // wait until the helo is near the lz
+ // IF THE PILOT IS DEAD OR CHOPPA DOWN ******************
+ if (getdammage helo > 0.7 or !alive pilot) exitWith {
+ deleteVehicle helipad1;
+ deleteMarker str(markerpickup);
+ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
+ // --- AJOUTER DE NOUVEAU LE SUPPORT
+ sleep 15;
+ calltaxifrombase = false;
+ helotax = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
+ helotax = helotax;
+ };
+ // ****************************************************
+
+ helo land "GET IN";
+
+ // spawn the door opening script
+ _pickupSpawnopen = [helo,_foundpickuppos] spawn {
+ helo = _this select 0;
+ _lzPos = _this select 1;
+ waitUntil {getpos helo distance _lzPos < 10};
+ helo animateDoor ['door_R', 1];
+ sleep 3;
+ helo animateDoor ['door_L', 1];
+ };
+
+ removeallactions helo;
+ _action = helo addaction ["Give a LZ to the pilot", {_null = [] execvm "support\taxi\mapclickhelo.sqf"; _null = [] call taxi;}, "", 0, true, true, "", "_this == player"];
+ _action2 = helo addaction ["Return to base", {pilot sideChat format["This is %1 %2-%3, we are returning to base",_fobname,_random1,_random2]; _null = [] call main;}, "", 0, true, true, "", "_this == player"];
+ //[markerpickup, helo, helogroup, pilot] call taxi;
+
+
+};///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+taxi = {
+ helo setfuel 1;
+
+ _fobname = [1] call compile preprocessFile "random_name.sqf";
+ _random1 = round random 9;
+ _random2 = round random 9;
+
+ waituntil {taxiCanTakeOff};
+ helo setfuel 1;
+ //removeallactions helo;
+
+ [player,helotax] call BIS_fnc_removeCommMenuItem;
+
+ // IF THE PILOT IS DEAD OR CHOPPA DOWN **************
+ if (getdammage helo > 0.7 or !alive pilot) exitWith {
+ deleteVehicle helipad1;
+ deleteMarker str(markerpickup);
+ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
+ sleep 15;
+ calltaxifrombase = false;
+ helotax = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
+ helotax = helotax;
+ // --- AJOUTER DE NOUVEAU LE SUPPORT
+ };
+ // *****************************
+
+
+ // everything is ok, player is in choppa
+ playMusic [_music, 0];
+ // helo lock true;
+ titleText ["Pilot: Roger that, we are oscar mike...", "PLAIN DOWN"];
+
+ deletemarker str(markerpickup);
+
+ markerpickup = format["lz%1%2", ClickedTaxiPos]; // Define marker name
+ _markerstr = createMarker [str(markerpickup), ClickedTaxiPos];
+ _markerstr setMarkerShape "ICON";
+ str(markerpickup) setMarkerType "hd_end";
+ str(markerpickup) setMarkerColor "ColorGreen";
+ str(markerpickup) setMarkerText "LZ";
+
+ str(markerpickup) setMarkerPos ClickedTaxiPos;
+
+ // create the helipad to land and the waypoints
+ helipad = createVehicle ["Land_HelipadEmpty_F", ClickedTaxiPos, [], 0, "NONE"];
+ _wp = helogroup addWaypoint [ClickedTaxiPos,0];
+ _wp setWaypointType "MOVE";
+ [helogroup, 1] setWaypointCombatMode "BLUE";
+
+ // spawn the door closing script
+ _pickupSpawnclose = [helo] spawn {
+ waitUntil {(istouchingground helo)};
+ helo animateDoor ['door_R', 0];
+ sleep 3;
+ helo animateDoor ['door_L', 0];
+ };
+
+ waitUntil {sleep 0.5;helo distance helipad1 > 350 or (getdammage helo > 0.7 or !alive pilot)}; // wait until the helo is away from LZ
+ // IF THE PILOT IS DEAD OR CHOPPA DOWN **************
+ if (getdammage helo > 0.7 or !alive pilot) exitWith {
+ deleteVehicle helipad1;
+ deleteVehicle helipad;
+ // helo lock false;
+ deleteMarker str(markerpickup);
+ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
+ // --- AJOUTER DE NOUVEAU LE SUPPORT
+ sleep 15;
+ calltaxifrombase = false;
+ helotax = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
+ helotax = helotax;
+ };
+ // *****************************
+ if (enableChopperFastTravel) then {
+ // TELEPORT HELO NEAR LZ
+ deleteVehicle helipad1;
+ titleText ["En route to LZ...", "BLACK OUT", 3];
+ sleep 3.5;
+ helo setpos [getpos helipad select 0, (getpos helipad select 1)+1000, 150];
+ sleep 3;
+ titleText ["En route to LZ...", "BLACK IN", 4];
+ };
+
+
+ waitUntil {ClickedTaxiPos distance helo < 200 or (getdammage helo > 0.7 or !alive pilot)}; // wait until the helo is near the lz
+ // IF THE PILOT IS DEAD OR CHOPPA DOWN **************
+ if (getdammage helo > 0.7 or !alive pilot) exitWith {
+ deleteVehicle helipad;
+ // helo lock false;
+ deleteMarker str(markerpickup);
+ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
+ // --- AJOUTER DE NOUVEAU LE SUPPORT
+ sleep 15;
+ calltaxifrombase = false;
+ helotax = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
+ helotax = helotax;
+ };
+ // *****************************
+ helo land "GET OUT";
+
+ // spawn the door opening script
+ _LzSpawnopen = [helo] spawn {
+ waitUntil {getpos helo distance ClickedTaxiPos < 20};
+ helo animateDoor ['door_R', 1];
+ sleep 3;
+ helo animateDoor ['door_L', 1];
+ };
+
+
+
+ // time to move ppl out of the helo;
+ waitUntil {(getpos helo select 2 < 4 && helo distance helipad<20) or (getdammage helo > 0.7 or !alive pilot)}; // wait until the helo is near the ground
+ // IF THE PILOT IS DEAD OR CHOPPA DOWN **************
+ if (getdammage helo > 0.7 or !alive pilot) exitWith {
+ deleteVehicle helipad;
+ // helo lock false;
+ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
+ // --- AJOUTER DE NOUVEAU LE SUPPORT
+ sleep 15;
+ calltaxifrombase = false;
+ helotax = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
+ helotax = helotax;
+ };
+ // *****************************
+ titleText ["Pilot: We have arrived at the LZ", "PLAIN DOWN"];
+ // helo lock false;
+ {doGetOut _x; sleep 1;} forEach assignedCargo helo; //units group player;
+
+ sleep 40;
+ deleteMarker str(markerpickup);
+
+ pilot sideChat format["This is %1 %2-%3, we are RTB",_fobname,_random1,_random2];
+
+ [markerpickup, helo, helogroup, pilot] call main;
+
+};/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+main = {
+ taxiCanTakeOff = false;
+
+ if (helipos distance helo < 10) exitwith {
+ removeallactions helo;
+ //_action = helo addaction ["Give a LZ to the pilot", "support\taxi\mapclickhelo.sqf", [markerpickup, helo, helogroup, pilot], 0, true, true, "", "_this == player"];
+ _action = helo addaction ["Give a LZ to the pilot", {_null = [] execvm "support\taxi\mapclickhelo.sqf"; _null = [] call taxi;}, "", 0, true, true, "", "_this == player"];
+ helo setfuel 0;
+ helo engineon false;
+
+ helotax = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
+ helotax = helotax;
+ //[markerpickup, helo, helogroup, pilot] call taxi;
+ };
+
+ if (helipos distance helo > 10) then {
+
+ // spawn the door closing script
+ _LzSpawnclose = [helo] spawn {
+ sleep 2;
+ helo animateDoor ['door_R', 0];
+ sleep 3;
+ helo animateDoor ['door_L', 0];
+ };
+
+ // create the helipad to land and the waypoints
+ helipad1 = createVehicle ["Land_HelipadEmpty_F", helipos, [], 0, "NONE"];
+ _wp = helogroup addWaypoint [[helipos select 0, (helipos select 1)-75], 0];
+ _wp setWaypointType "MOVE";
+ [helogroup, 1] setWaypointCombatMode "BLUE";
+
+ _fobname = [1] call compile preprocessFile "random_name.sqf";
+ _random1 = round random 9;
+ _random2 = round random 9;
+
+
+ waitUntil {helipos distance helo < 350 or (getdammage helo > 0.7 or !alive pilot)}; // wait until the helo is near the lz
+ // IF THE PILOT IS DEAD OR CHOPPA DOWN ******************
+ if (getdammage helo > 0.7 or !alive pilot) exitWith {
+ deleteVehicle helipad1;
+ deleteMarker str(markerpickup);
+ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
+ // --- AJOUTER DE NOUVEAU LE SUPPORT
+ sleep 15;
+ calltaxifrombase = false;
+ helotax = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
+ helotax = helotax;
+ };
+ // ****************************************************
+
+ // spawn smokeshell
+ _smokePos = [helipos select 0, (helipos select 1)+ random 5];
+ _smoke = "SmokeShellGreen" createVehicle _smokePos;
+ _chemlight = "Chemlight_green" createVehicle _smokePos;
+
+ helo land "GET IN";
+
+ // spawn the door opening script
+ _pickupSpawnopen = [helo,helipos] spawn {
+ waitUntil {getpos helo distance helipos < 10};
+ helo animateDoor ['door_R', 1];
+ sleep 3;
+ helo animateDoor ['door_L', 1];
+ };
+
+ waituntil {(istouchingground helo)};
+ removeallactions helo;
+ _action = helo addaction ["Give a LZ to the pilot", {_null = [] execvm "support\taxi\mapclickhelo.sqf"; _null = [] call taxi;}, "", 0, true, true, "", "_this == player"];
+ helo setfuel 0;
+ helo engineon false;
+
+ helotax = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
+ helotax = helotax;
+ //[markerpickup, helo, helogroup, pilot] call taxi;
+ };
+
+};/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+start = {
+ _foundPickupPos = [];
+ taxiCanTakeOff = false;
+ _hqpos = PosOfBLUHQ;
+
+ _music = call compile preprocessFile "support\taxi\random_music.sqf";
+
+ if (commandpointsblu1 < 1) exitWith {
+ ["info",["Not enough command points","Not enough Command Points (1 CP required)"]] call bis_fnc_showNotification;
+ sleep 15;
+ helotax = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
+ helotax = helotax;
+ };
+
+ _foundPickupPos = [_hqpos, 0,50,10,0,0.2,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos; // find a valid pos
+
+ // try to find a pos, if no pos is found exit the script
+ if (0 == _foundPickupPos select 0 && 0 == _foundPickupPos select 1) exitWith {hint "No valid LZ nearby"; sleep 5; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;};
+
+ // create marker on LZ
+ markerpickup = format["lz%1%2", _foundPickupPos]; // Define marker name
+ _markerstr = createMarker [str(markerpickup), _foundPickupPos];
+ _markerstr setMarkerShape "ICON";
+ str(markerpickup) setMarkerType "hd_end";
+ str(markerpickup) setMarkerColor "ColorGreen";
+ str(markerpickup) setMarkerText "LZ";
+
+ // A POS NEAR THE PLAYER HAS BEEN FOUND, CHOOPA EN ROUTE
+ commandpointsblu1 = commandpointsblu1 - 1;
+ publicVariable "commandpointsblu1";
+
+ // create the chopper, gunners and pilots
+ helo = createVehicle ["B_Heli_Transport_01_camo_F", [_hqpos select 0, (_hqpos select 1)+2000, 200],[], 0, "FLY"];
+ helogroup = createGroup west;
+ pilot = helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"];
+ _copilot = helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"];
+ _gunner1 = helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"];
+ _gunner2 = helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"];
+ helo flyInHeight 150;
+
+ pilot setcaptive true;
+ pilot allowfleeing 0;
+ pilot disableAI "Target";
+
+ pilot moveindriver helo;
+ _copilot moveInTurret [helo, [0]];
+ _gunner1 moveInTurret [helo, [1]];
+ _gunner2 moveInTurret [helo, [2]];
+
+ // spawn the door closing script
+ _LzSpawnclose = [helo] spawn {
+ helo = _this select 0;
+ sleep 2;
+ helo animateDoor ['door_R', 0];
+ sleep 3;
+ helo animateDoor ['door_L', 0];
+ };
+
+ // create the helipad to land and the waypoints
+ helipad1 = createVehicle ["Land_HelipadEmpty_F", _foundPickupPos, [], 0, "NONE"];
+ _wp = helogroup addWaypoint [[_foundPickupPos select 0, (_foundPickupPos select 1)-75], 0];
+ _wp setWaypointType "MOVE";
+ [helogroup, 1] setWaypointCombatMode "BLUE";
+
+ _fobname = [1] call compile preprocessFile "random_name.sqf";
+ _random1 = round random 9;
+ _random2 = round random 9;
+
+ pilot sideChat format["This is %1 %2-%3, we are approaching your location for pick up, check your map for the LZ",_fobname,_random1,_random2];
+
+ waitUntil {_foundPickupPos distance helo < 350 or (getdammage helo > 0.7 or !alive pilot)}; // wait until the helo is near the lz
+ // IF THE PILOT IS DEAD OR CHOPPA DOWN ******************
+ if (getdammage helo > 0.7 or !alive pilot) exitWith {
+ deleteVehicle helipad1;
+ deleteMarker str(markerpickup);
+ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1,_random2];
+ // --- AJOUTER DE NOUVEAU LE SUPPORT
+ sleep 15;
+ calltaxifrombase = false;
+ helotax = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
+ helotax = helotax;
+ };
+ // ****************************************************
+
+ // spawn smokeshell
+ _smokePos = [_foundPickupPos select 0, (_foundPickupPos select 1)+ random 5];
+ _smoke = "SmokeShellGreen" createVehicle _smokePos;
+ _chemlight = "Chemlight_green" createVehicle _smokePos;
+
+ helo land "GET IN";
+
+ // spawn the door opening script
+ _pickupSpawnopen = [helo,_foundPickupPos] spawn {
+ helo = _this select 0;
+ _lzPos = _this select 1;
+ waitUntil {getpos helo distance _lzPos < 10};
+ helo animateDoor ['door_R', 1];
+ sleep 3;
+ helo animateDoor ['door_L', 1];
+ };
+
+ waituntil {(istouchingground helo)};
+ helipos = getpos helo;
+ calltaxifrombase = true;
+
+ [markerpickup, helo, helogroup, pilot] call main;
+};////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+if (!calltaxifrombase) then {
+ [] call start;
+} else {
+ [] call calltaxi;
+};
\ No newline at end of file