Guest User

Untitled

a guest
Feb 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. if (!isServer) then {
  2.  
  3.  
  4. // Variables
  5.  
  6. _group = _this select 0;
  7. _Mout = _this select 1;
  8. _min_sleep = 3;
  9. _max_sleep = 7;
  10.  
  11. _Man_array =
  12.  
  13. ["M252_US_EP1","US_Soldier_Medic_EP1","US_Soldier_Engineer_EP1","US_Soldier_Crew_EP1","Pierce","US_Soldier_TL_EP1" ];
  14.  
  15. _Tank_array =
  16.  
  17. ["sa_m109a6_des","M1A2_TUSK_MG","ACE_M1A1HA_TUSK","ACE_M2A3_W","ACE_M6A1_W","ACE_M113A3","ACE_M113A3_Ambul","MtvrReammo_DES
  18.  
  19. _EP1","ACE_Truck5tMG","ACE_Truck5tReammo","LoBo_US1991_M728W","ACE_Truck5tRepair","ACE_Truck5tRefuel","MtvrRefuel_DES_EP1",
  20.  
  21. "MtvrRepair_DES_EP1","MtvrSalvage_DES_EP1"];
  22.  
  23. _AIR_array = ["UH60M_MEV_EP1","AH64D_EP1","ACE_AH6J_DAGR_FLIR","UH60M_EP1"];
  24.  
  25. _All_array = _Man_array + _Tank_array + _AIR_array;
  26. //_All_array =
  27.  
  28. ["M252_US_EP1","US_Soldier_Medic_EP1","US_Soldier_Engineer_EP1","US_Soldier_Crew_EP1","Pierce","US_Soldier_TL_EP1","sa_m109
  29.  
  30. a6_des","M1A2_TUSK_MG","ACE_M1A1HA_TUSK","ACE_M2A3_W","ACE_M6A1_W","ACE_M113A3","ACE_M113A3_Ambul","MtvrReammo_DES_EP1","AC
  31.  
  32. E_Truck5tMG","ACE_Truck5tReammo","LoBo_US1991_M728W","ACE_Truck5tRepair","ACE_Truck5tRefuel","MtvrRefuel_DES_EP1","MtvrRepa
  33.  
  34. ir_DES_EP1","MtvrSalvage_DES_EP1","UH60M_MEV_EP1","AH64D_EP1","ACE_AH6J_DAGR_FLIR","UH60M_EP1"];
  35.  
  36. _Mout_array =
  37.  
  38. ["M252_US_EP1","US_Soldier_Medic_EP1","US_Soldier_Engineer_EP1","US_Soldier_Crew_EP1","Pierce","US_Soldier_TL_EP1","sa_m109
  39.  
  40. a6_des","M1A2_TUSK_MG","ACE_M1A1HA_TUSK","ACE_M2A3_W","ACE_M6A1_W","ACE_M113A3","ACE_M113A3_Ambul","MtvrReammo_DES_EP1","AC
  41.  
  42. E_Truck5tMG","ACE_Truck5tReammo","LoBo_US1991_M728W","ACE_Truck5tRepair","ACE_Truck5tRefuel","MtvrRefuel_DES_EP1","MtvrRepa
  43.  
  44. ir_DES_EP1","MtvrSalvage_DES_EP1"];
  45.  
  46. _Slow_loop = 1;
  47.  
  48. //functions
  49.  
  50. _func_Count = {
  51. private ["_group", "_distance", "_types_array"];
  52. _group = _this select 0;
  53. _distance = _this select 1;
  54. _types_array = _this select 2;
  55.  
  56.  
  57. _Unit_array = (position (leader _group)) nearEntities [_types_array, _distance];
  58. _Unit_count = west countSide _Unit_array
  59.  
  60. };
  61.  
  62. _func_cache_on = {
  63. private ["_group"];
  64. _group = _this select 0;
  65.  
  66. {
  67. _x enableSimulation true;
  68. _x enableAI "TARGET";
  69. _x enableAI "AUTOTARGET";
  70. _x enableAI "Move";
  71. _x enableAI "ANIM";
  72. _x enableAI "FSM";
  73.  
  74. } foreach units _group;
  75.  
  76.  
  77. };
  78.  
  79. _func_cache_off = {
  80. private ["_group"];
  81. _group = _this select 0;
  82.  
  83. {
  84. _x enableSimulation false;
  85. _x disableAI "TARGET";
  86. _x disableAI "AUTOTARGET";
  87. _x disableAI "Move";
  88. _x disableAI "ANIM";
  89. _x disableAI "FSM";
  90.  
  91. } foreach units _group;
  92.  
  93. };
  94.  
  95.  
  96.  
  97.  
  98. // set units to sleep
  99.  
  100.  
  101. While {alive (leader _group) } do {
  102.  
  103.  
  104. [_Group] call _func_cache_off;
  105.  
  106.  
  107.  
  108.  
  109. //enter slow loop
  110.  
  111. while { _Slow_loop == 1 } do {
  112.  
  113. _unit_count = [_group, 4000, _All_array ] call _func_Count;
  114. if ( _unit_count <= 0) then {
  115. Sleep ( 7 + (random 3));
  116. } else {
  117. _Slow_loop = 0;
  118. };
  119. };
  120.  
  121. while { _Slow_loop == 0 } do {
  122.  
  123. if (_Mout == 0) then {
  124. _unit_count1 = [_group, 2000, _air_array ] call _func_Count;
  125. _unit_count2 = [_group, 1600, _Tank_array ] call _func_Count;
  126. _unit_count3 = [_group, 500, _Man_array ] call _func_Count;
  127. _unit_count = _unit_count1 + _unit_count2 + _unit_count3;
  128. };
  129.  
  130. if (_Mout == 1) then {
  131. _unit_count = [_group, 200, _Mout_array ] call _func_Count;
  132. };
  133.  
  134.  
  135. if ( _unit_count <= 0) then {
  136. _Slow_loop = 1;
  137. } else {
  138. if (! simulationEnabled (leader _Group) then {
  139. [_Group] spawn _func_cache_on;
  140. };
  141.  
  142. Sleep (3 + (random 1));
  143. };
  144.  
  145. };
  146.  
  147.  
  148. };
  149. };
Add Comment
Please, Sign In to add comment