Created
September 26, 2012 21:38
-
-
Save psykzz/3790755 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Configurational Defines. | |
#define EVAC_HELI "MH6J_EP1" | |
_wait = 2; | |
// Functions | |
FNC_moveToAndLand = { // USAGE : _evacHeli, _Destination] call FNC_moveToAndLand; | |
private ["_heli","_dest","_pilot"]; | |
_evacHeli = _this select 0; | |
_dest = _this select 1; | |
_pilot = (crew _evacHeli select 0); | |
_pilot doMove _dest; | |
sleep 5; | |
while { ( (alive _pilot) && !(unitReady _pilot) ) } do | |
{ sleep 1; }; | |
if (alive _pilot) then | |
{ _evacHeli land "GETIN"; }; | |
}; | |
//Initialize | |
_wSideHQ = createCenter west; | |
_eSideHQ = createCenter east; | |
player globalChat "Spawning evac heli..."; | |
player addmagazine "SmokeShellRed"; sleep 0.5; | |
player selectWeapon "SmokeShellRed"; sleep 0.5; | |
_evacGroup = createGroup west; | |
//_evacHeliSpawnMarkers = ["evacSpawn_1","evacSpawn_2","evacSpawn_3"]; | |
_evacHeliSpawn = getMarkerPos "evacSpawn_1"; | |
//Spawn Helo | |
_evacHeli = createVehicle [EVAC_HELI, _evacHeliSpawn, [], 0, "NONE"]; | |
// Spawn Crew | |
_pilot = _evacGroup createUnit ["USMC_Soldier_Pilot", _evacHeliSpawn, [], 0, "NONE"]; | |
[_pilot] join _evacGroup; | |
_pilot assignAsDriver _evacHeli; | |
_pilot moveInDriver _evacHeli; | |
//init | |
_radius = 1500; | |
_found = FALSE; | |
//loop check | |
while {(alive _evacHeli)} do { | |
_smokearray = (position player) nearObjects ["SmokeShellRed",_radius]; | |
_qty = count _smokearray; | |
if (_qty > 0) then { | |
//Smoke has been dropped | |
_smoke = _smokearray select 0; | |
_smokePos = position _smoke; | |
_found = TRUE; | |
[_evacHeli, _smokePos] call FNC_moveToAndLand; | |
}; | |
sleep _wait; | |
if (_found) exitWith {}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment