Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EVAC_HELI_spawnMarker = "heliBase"; // STRING - marker name of where to start and delete the helicopter.
- EVAC_HELI_helicopterType = "B_Heli_Transport_01_F"; // STRING - class name of the helicopter to use.
- EVAC_HELI_hovering = false;
- EVAC_HELI_feedback = true; // BOOL - Yell smoke out like a boss?
- if (isNil "EVAC_HELI_Active") then {EVAC_HELI_Active = false;};
- EVAC_Heli_addEventHandler = {
- args = _this;
- _heli = _this select 1;
- _helicaller = _this select 0;
- _idx = _helicaller addEventHandler ["Fired", {
- if ((_this select 4) != "SmokeShell") exitWith {};
- _null = (_this select 6) spawn {
- _posg = getPos _this;
- sleep 0.5;
- while {(_posg distance (getPos _this)) > 0} do {
- _posg = getPos _this;
- sleep 0.5;
- };
- player sideChat "Smoke seen. Landing now";
- };
- }];
- };
- EVAC_Heli_moveTo = {
- if(EVAC_HELI_Active) exitwith {hint "Evac chopper is not available at this time";};
- EVAC_HELI_Active = true;
- _helicaller = _this select 0;
- _dist = 50 + random 25;
- _dir = random 360;
- _spawnPos = getMarkerPos EVAC_HELI_spawnMarker;
- _hoverPos = [(getPos _helicaller select 0) + (sin _dir) * _dist, (getPos _helicaller select 1) + (cos _dir) * _dist];
- hint format ["Point Marked: %1",_hoverpos];
- sleep 1;
- _tmp = createMarker ["Helimarker",_hoverpos];
- _tmp setMarkerShape "ICON";
- _tmp setMarkerType "hd_dot";
- _tmp setMarkerColor "ColorOpFor";
- // Spawn helicopter and crew.
- _helisv = [_spawnPos, [_spawnPos, _hoverpos] call BIS_fnc_dirTo , EVAC_HELI_helicopterType, west] call BIS_fnc_spawnVehicle;
- _heli = _helisv select 0;
- _heliCrew = _helisv select 1;
- _heliGroup = _helisv select 2;
- (driver _heli) allowFleeing 0;
- // Waypoint to the location for heli
- _wp1 = _heliGroup addWaypoint [_hoverpos, 0];
- _wp1 setWaypointSpeed "FULL";
- _wp1 setWaypointType "MOVE";
- _wp1 setWaypointStatements ["true", "EVAC_HELI_hovering=true;"];
- _heli flyInHeight 60;
- waituntil{EVAC_HELI_hovering};
- _heli sideChat "Evac chopper awaiting confirmation of LZ. Mark it with Green Smoke and we'll bring her down";
- [_helicaller,_heli] spawn EVAC_Heli_addEventHandler;
- };
- _caller = _this select 0;
- [_caller] call EVAC_Heli_moveTo;
Add Comment
Please, Sign In to add comment