Created
June 4, 2016 16:39
-
-
Save DEL-J/39a13c663b8081194b2305aa6b9d2e63 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
if (isServer) then { | |
GreenReinforcements = []; | |
RedReinforcements = []; | |
addMissionEventHandler ["EntityRespawned",{ | |
params ["_spawned"]; | |
if (side _spawned == independent && isPlayer _spawned && !(_spawned in GreenReinforcements)) then { | |
GreenReinforcements pushBack _spawned; | |
}; | |
if (side _spawned == east && isPlayer _spawned && !(_spawned in RedReinforcements)) then { | |
RedReinforcements pushBack _spawned; | |
}; | |
}]; | |
IN_fnc_spawnGreenWave = { | |
if (!isServer) exitWith {}; | |
GreenReinforcements = GreenReinforcements select { | |
isPlayer _x | |
}; | |
_queue = []; | |
{ | |
if(count _queue >= 16) then { | |
[_queue] spawn IN_fnc_spawnGreenHeli; | |
_queue = []; | |
}; | |
_queue pushBack _x; | |
} forEach GreenReinforcements; | |
[_queue] spawn IN_fnc_spawnGreenHeli; | |
GreenReinforcements = []; | |
}; | |
IN_fnc_spawnGreenHeli = { | |
params["_units"]; | |
// find a clear area | |
_minDistance = 20; | |
_spawnPos = getMarkerPos "GreenSpawn"; | |
_isPosClear = false; | |
while {! _isPosClear} do { | |
_spawnPos = _spawnPos getPos [20 + random 20, random 360]; | |
_near = _spawnPos nearEntities [["Man","Steerable_Parachute_F"], _minDistance]; | |
if (count _near == 0) then { | |
_isPosClear = true; | |
}; | |
}; | |
_GreenChopper = [_spawnPos, 270, "I_Heli_Transport_02_F", independent] call BIS_fnc_spawnVehicle; | |
_Chopper = _GreenChopper select 0; | |
_Cargo = _GreenChopper select 1; | |
_GreenPilots = _GreenChopper select 2; | |
// this is where we will move the players into the helicopter. | |
{ | |
_x hideObjectGlobal false; | |
_x enableSimulationGlobal true; | |
_x moveInCargo _chopper; | |
["Terminate"] remoteExec ["BIS_fnc_EGSpectator", _x]; | |
} forEach _units; | |
_Chopper setVehicleLock "LOCKED"; | |
_Chopper allowDamage false; | |
(driver _Chopper) allowDamage false; | |
(driver _Chopper) disableAI "TARGET"; | |
(driver _Chopper) disableAI "AUTOTARGET"; | |
(driver _Chopper) disableAI "FSM"; | |
(driver _Chopper) setBehaviour "Careless"; | |
(driver _Chopper) setCombatMode "Blue"; | |
_GreenPilots enableAttack false; | |
_WP1 = _GreenPilots addWaypoint [(getmarkerpos "M1"), 0]; | |
_WP1 setWayPointBehaviour "CARELESS"; | |
_WP1 setWaypointType "TR UNLOAD"; | |
_WP1 setWaypointSpeed "FULL"; | |
_WP1 setWayPointCombatMode "BLUE"; | |
_WP1 setwaypointstatements ["true","this land 'land'"]; | |
waitUntil { | |
sleep 1; | |
(getPos _Chopper) select 2 <= 2 | |
}; | |
_Chopper AnimateDoor ["Door_Back_R",1]; | |
_Chopper AnimateDoor ["Door_Back_L",1]; | |
_Chopper AnimateDoor ["CargoRamp_Open",1]; | |
{ | |
_x action ["Eject", vehicle _x]; | |
} forEach _units; | |
sleep 28; | |
_Chopper AnimateDoor ["Door_Back_R",0]; | |
_Chopper AnimateDoor ["Door_Back_L",0]; | |
_Chopper AnimateDoor ["CargoRamp_Open",0]; | |
sleep 1; | |
_WP2 = _GreenPilots addWaypoint [(getmarkerpos "GreenSpawn"), 0]; | |
_WP2 setWayPointBehaviour "CARELESS"; | |
_WP2 setWaypointType "MOVE"; | |
_WP2 setWayPointCombatMode "BLUE"; | |
_WP2 setWaypointSpeed "FULL"; | |
_WP2 setwaypointstatements ["true", " | |
private _Vic = (vehicle this); | |
{_Vic deleteVehicleCrew _x} forEach (crew _Vic); | |
deleteVehicle _Vic;" | |
]; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment