Advertisement
TBsThug

flyby.sqf from 1051

Jul 10th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. private["_model","_startpos","_endpos","_rand_player"];
  2.  
  3. _model = [
  4. "A10",
  5. "AH64D_EP1",
  6. "AV8B",
  7. "C130J_US_EP1",
  8. "F35B",
  9. "Ka137_MG_PMC",
  10. "Ka52",
  11. "L39_TK_EP1",
  12. "MQ9PredatorB_US_EP1",
  13. "MV22",
  14. "Mi24_D",
  15. "Su25_CDF",
  16. "Su25_TK_EP1",
  17. "pook_H13_gunship"
  18. ] call BIS_fnc_selectRandom;
  19.  
  20. _startpos = [
  21. [1000.0,2.0],
  22. [3500.0,2.0],
  23. [5000.0,2.0],
  24. [7500.0,2.0],
  25. [9712.0,663.067],
  26. [12304.0,1175.07],
  27. [14736.0,2500.0],
  28. [16240.0,5000.0],
  29. [16240.0,7500.0],
  30. [16240.0,10000.0]
  31. ] call BIS_fnc_selectRandom;
  32.  
  33. _rand_player = playableUnits call BIS_fnc_selectRandom;
  34.  
  35. if((isPlayer _rand_player) && (alive _rand_player)) then {
  36.  
  37. _rand_num = ceil(random 5);
  38. _playerpos = [_rand_player] call FNC_GetPos;
  39. _number = 0;
  40.  
  41. for "_i" from 1 to _rand_num do {
  42.  
  43. _number = (_number + 1);
  44.  
  45. [_number,_model,_startpos,_playerpos] spawn {
  46.  
  47. private["_aircraft","_aigroup","_pilot","_wp1","_wp2","_cor_y","_cor_x"];
  48.  
  49. _number = _this select 0;
  50. _model = _this select 1;
  51. _startpos = _this select 2;
  52. _playerpos = _this select 3;
  53. _endpos = [0,16000,200];
  54.  
  55. call {
  56. if(_number == 1) exitWith {
  57. _cor_y = 0;
  58. _cor_x = 0;
  59. };
  60.  
  61. if(_number == 2) exitWith {
  62. _cor_y = -60;
  63. _cor_x = -60;
  64. };
  65.  
  66. if(_number == 3) exitWith {
  67. _cor_y = -60;
  68. _cor_x = 60;
  69. };
  70.  
  71. if(_number == 4) exitWith {
  72. _cor_y = -120;
  73. _cor_x = -120;
  74. };
  75.  
  76. if(_number == 5) exitWith {
  77. _cor_y = -120;
  78. _cor_x = 120;
  79. };
  80. };
  81.  
  82. _aircraft = createVehicle [_model,[((_startpos select 0) + _cor_y),((_startpos select 1) + _cor_x),200],[],0,"FLY"];
  83. _aircraft engineOn true;
  84. _aircraft flyInHeight 200;
  85.  
  86. _aigroup = creategroup civilian;
  87.  
  88. _pilot = _aigroup createUnit ["SurvivorW2_DZ",[_aircraft] call FNC_GetPos,[],0,"FORM"];
  89. _pilot setCombatMode "BLUE";
  90. _pilot moveindriver _aircraft;
  91. _pilot assignAsDriver _aircraft;
  92.  
  93. _wp1 = _aigroup addWaypoint [[((_playerpos select 0) + _cor_y),((_playerpos select 1) + _cor_x),200],0];
  94. _wp1 setWaypointType "MOVE";
  95. _wp1 setWaypointBehaviour "CARELESS";
  96.  
  97. _wp2 = _aigroup addWaypoint [[(_endpos select 0),(_endpos select 1),200],0];
  98. _wp2 setWaypointType "MOVE";
  99. _wp2 setWaypointBehaviour "CARELESS";
  100.  
  101. waitUntil { (_aircraft distance _endpos < 500) };
  102.  
  103. deleteVehicle _aircraft;
  104. deleteGroup _aigroup;
  105. deleteVehicle _pilot;
  106.  
  107. };
  108. };
  109. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement