Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. //Todo;
  2. //- #help system mit https://github.com/CBATeam/CBA_A3/wiki/Registering-Custom-Chat-Commands
  3. // - if Zeugs zum Laufen bringen
  4.  
  5. //Debug Marker for Vehicle
  6. Debug = true;
  7.  
  8. hint "Mission in being Initialized";
  9.  
  10. private "_marker";
  11. _marker = [
  12. "marker_51"
  13. //,"marker_52"
  14. //,"marker_53"
  15. //,"marker_54"
  16. //,"marker_55"
  17. ] call Bis_fnc_selectRandom;
  18.  
  19. [blufor,["task"],["Stop the Vehicle and Capture/Eliminate all Criminals","Vehicle fleeing in this Area",""],_marker,"ASSIGNED",2,true,"",false] call BIS_fnc_taskCreate;
  20.  
  21. //_spot = (_marker) nearRoads 100;
  22. private "_spot";
  23. _spot = [[[_marker, 200]],["water"]] call BIS_fnc_randomPos;
  24.  
  25. private "_vehicleType";
  26. _vehicleType = ["C_Offroad_01_F","C_Hatchback_01_F","C_Offroad_02_unarmed_F","C_SUV_01_F"] call BIS_fnc_selectRandom;
  27.  
  28. veh = _vehicleType createVehicle _spot;
  29. [veh, true, true, true] call bis_fnc_initVehicle;
  30.  
  31. enemys = createGroup [east, true];
  32.  
  33. private "_unit";
  34. _unit = enemys createUnit ["O_G_officer_F",getPos veh,[],4,"NONE"];
  35. _unit moveInAny veh;
  36. private "_unit2";
  37. _unit2 = enemys createUnit ["O_G_officer_F",getPos veh,[],4,"NONE"];
  38. _unit2 moveInAny veh;
  39. private "_unit3";
  40. _unit3 = enemys createUnit ["O_G_officer_F",getPos veh,[],4,"NONE"];
  41. _unit3 moveInAny veh;
  42. private "_unit4";
  43. _unit4 = enemys createUnit ["O_G_officer_F",getPos veh,[],4,"NONE"];
  44. _unit4 moveInAny veh;
  45. [_unit,_unit2,_unit3,_unit4] join enemys;
  46.  
  47. enemys allowFleeing 0.8;
  48. enemys setBehaviour "SAFE";
  49.  
  50. [enemys,_marker,2000] call bis_fnc_taskPatrol;
  51.  
  52.  
  53. [300,true] call BIS_fnc_countDown;
  54. countdown = missionNamespace getVariable "bis_fnc_countdown_time";
  55.  
  56. hint "Mission Initialized";
  57.  
  58. sleep 2;
  59.  
  60. private "_taskactive";
  61. _taskActive = true;
  62.  
  63. while {_taskActive} do
  64. {
  65. if (debug) then
  66. {
  67.  
  68. createMarker ["carmarker", getpos veh];
  69. "carmarker" setMarkerColor "ColorRed";
  70. "carmarker" setMarkerType "mil_objective";
  71.  
  72. while {true} do
  73. {
  74.  
  75. "carmarker" setmarkerpos (getpos veh);
  76.  
  77. sleep 0.5;
  78.  
  79. };
  80.  
  81. if (noenemy) then
  82. {
  83. deleteMarker "carmarker"
  84. };
  85. };
  86.  
  87. if (!noenemy) then
  88. {
  89. //Erfolgreich
  90. ["task", "SUCCEEDED", true] call BIS_fnc_taskSetState;
  91. _taskActive = false;
  92. ["itemRemove", ["hintloop"]] call BIS_fnc_loop;
  93. };
  94.  
  95. if (countdown == 0) then
  96. {
  97. //Fehlgeschlagen
  98. ["task", "FAILED", true] call BIS_fnc_taskSetState;
  99. _taskActive = false;
  100. ["itemRemove", ["hintloop"]] call BIS_fnc_loop;
  101. };
  102. //Aufgeben - noch mit Zufallssystem erweitern
  103.  
  104. if (({alive _x} count units enemys) < 3) then
  105. {
  106. systemChat "Surrender wird ausgeführt";
  107.  
  108. {
  109. _x setCaptive true;
  110. player action ["Surrender", _x];
  111. if (alive _x) then
  112. {
  113. _x addAction ["Arrest",
  114. {
  115. [_this select 0, "GUARD", "ASIS"] call BIS_fnc_ambientAnim;
  116. }];
  117. };
  118. } forEach units enemys;
  119.  
  120. };
  121.  
  122. //Aus Fahrzeug ziehen
  123. if (speed (veh) == 0) then
  124. {
  125. systemChat "GetOut wird ausgeführt";
  126. private "_unitDriver";
  127. _unitDriver = driver veh;
  128.  
  129. vehicle _unitDriver addAction ["Pull out",
  130. {
  131. player action ["getOut", vehicle _unitDriver];
  132. sleep 0.1;
  133. player action ["Surrender", _this select 0];
  134. _unitDriver addAction ["Arrest",
  135. {
  136. [_this select 0, "GUARD", "ASIS"] call BIS_fnc_ambientAnim;
  137. }];
  138. }];
  139. };
  140.  
  141. ["itemAdd", ["hintloop", {hintSilent format ["Time: %1",countdown ];}, 0.5]] call BIS_fnc_loop;
  142. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement