Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.95 KB | None | 0 0
  1. /*
  2. file: fn_asylumSeekers.sqf
  3. Author: Fresqo
  4. Description: spawns asylum seekers at some locations with a civ location to take seekers to and a cop location to take seekers to and get paid. kos marker and side dependant on drop markers
  5. - flares?
  6. - sombrero hats?
  7. TODO
  8. - remove spawn around code
  9. - add a timer
  10. */
  11.  
  12. /* SETTINGS */
  13. uiSleep (60 * 1); //time before shit starts
  14. //uiSleep random (3000);
  15. private _pos = [[3907.96,8938.07,0]]; //spawn locations for asylum seekers
  16. private _dropLocs = [[4839.374,2222.744,0.00144958]]; //drop off locations for asylum seekers
  17. private _value = 35000; //payout when seeker sorted
  18. private _headGears = ["A3L_Legoman","A3L_mexicanhat"];
  19. private _amount = 4; //amount of asylum seekers (definite)
  20. private _random = 11; //amount of extra chance asylum seekers
  21. private _timer = (40 * 60); //timer for the whole mission
  22. private _cMarker = "cop_ship_3"; //cop marker name where cops can take seekers and get money
  23. private _copsNeeded = 3;
  24.  
  25. /* ::: DO NOT TOUCH BELOW ::: */
  26. diag_log "::: SIVLERLAKE ASYLUM SEEKERS STARTED :::";
  27. private _spawnPos = _pos select floor random count _pos;
  28. private _dropLoc = _dropLocs select floor random count _dropLocs;
  29. private _time = time;
  30. //if ({side _x isEqualTo west} count playableUnits < _copsNeeded) exitWith {[] execVM "\life_server\Functions\Missions\fn_asylumSeekers.sqf";};
  31.  
  32. //missionNamespace setVariable ["asylums",true,true];
  33. private _cnt = round(random(_random));
  34. private _seekers = [];
  35. for "_i" from 1 to (_cnt + _amount) do
  36. {
  37. _unit = ([[0,0,999], 180, "C_man_1", civilian] call bis_fnc_spawnvehicle) select 0;
  38. _spawnPos set[0,(_spawnPos select 0)+random(30)];
  39. _spawnPos set[1,(_spawnPos select 1)+random(30)];
  40. if (count _headGears > 0) then
  41. {
  42. _headGear = _headGears select floor random count _headGears;
  43. _unit addHeadgear _headGear;
  44. };
  45. _unit setPos _spawnPos;
  46. _unit setVariable["asylumseeker",true,true];
  47. _seekers pushBack _unit;
  48. };
  49.  
  50. /* CREATE MARKERS AND MESSAGES */
  51. ["<t align='center'><t size='1'><t size='1.1'><t color='#FF0000'>Asylum Seeker Mission</t></t><br/><t size='.8'>An asylum seeker boat has capsized. The rebels are paying top price for their clear entrance into Kamden, go pick them up in a boat and take them to the drop point!</t>"] remoteExec["anzmsg",civilian];
  52.  
  53. [0,[_spawnPos,_timer,"Mil_dot","Asylum Seekers"]] remoteExec ["life_fnc_markers",civilian];
  54. [0,[_dropLoc,_timer,"Mil_dot","Asylum Seeker Drop Zone"]] remoteExec ["life_fnc_markers",civilian];
  55.  
  56. FNC_seeker =
  57. {
  58. params [
  59. "_seeker",
  60. "_dropLoc",
  61. "_value",
  62. "_timer",
  63. "_mark"
  64. ];
  65. private _cnt = 0;
  66. while {alive _seeker} do
  67. {
  68. private _objs = nearestObjects [_seeker, [], 10];
  69. if (count _objs > 0 && (vehicle _seeker isEqualTo _seeker)) then
  70. {
  71. {
  72. if (_x isKindOf "Ship" && !(_seeker getVariable["inboat",false]) && isPlayer (driver _x)) exitWith
  73. {
  74. _seeker moveInCommander _x;
  75. _seeker moveInGunner _x;
  76. _seeker moveInCargo _x;
  77. _seeker setVariable ["inboat",true,true];
  78. };
  79. } forEach _objs;
  80. };
  81. if ((_seeker distance (getMarkerPos _mark) < 20) && (_seeker getVariable ["inboat",false]) && side (driver (vehicle _seeker)) isEqualTo west) exitWith
  82. {
  83. _payee = driver (vehicle _seeker);
  84. if (isNull _payee) exitWith {diag_log "ASYLUM BUG1 RPT1"};
  85. [_value] remoteExecCall ["life_fnc_payCash",_payee];
  86. [0,format["You have received $%1 for bringing an asylum seeker back to PD for proper processing",_value]] remoteExec ["life_fnc_broadcast",_payee];
  87. (vehicle _seeker) deleteVehicleCrew _seeker;
  88. };
  89. if (_seeker distance _dropLoc < 30 && (_seeker getVariable ["inboat",false]) && side (driver (vehicle _seeker)) isEqualTo civilian) exitWith
  90. {
  91. _payee = driver (vehicle _seeker);
  92. if (isNull _payee) exitWith {diag_log "ASYLUM BUG1 RPT2"};
  93. [_value] remoteExecCall ["life_fnc_payCash",_payee];
  94. [getPlayerUID _payee,_payee getVariable ["realname",name _payee],"34",_payee] remoteExecCall ["life_fnc_wantedAdd",2];
  95. [0,format["You have received $%1 for smuggling an asylum seeker into Australia",_value]] remoteExec ["life_fnc_broadcast",_payee];
  96. (vehicle _seeker) deleteVehicleCrew _seeker;
  97. };
  98.  
  99. uiSleep 2;
  100. if (vehicle _seeker isEqualTo _seeker && (_seeker getVariable["inboat",false])) then {_seeker setVariable["inboat",false,true];};
  101. _cnt = _cnt + 2;
  102. if (_cnt >= _timer) exitWith
  103. {
  104. if !(vehicle _seeker isEqualTo _seeker) then
  105. {
  106. (vehicle _seeker) deleteVehicleCrew _seeker;
  107. };
  108. deleteVehicle _seeker;
  109. };
  110. };
  111.  
  112. if (!isNull _seeker) then
  113. {
  114. if !(vehicle _seeker isEqualTo _seeker) then
  115. {
  116. (vehicle _seeker) deleteVehicleCrew _seeker;
  117. };
  118. deleteVehicle _seeker;
  119. };
  120. };
  121.  
  122. {[_x,_dropLoc,_value,_timer,_cMarker] spawn FNC_seeker;} forEach _seekers;
  123.  
  124. [_spawnPos,_time,_timer] spawn
  125. {
  126. uiSleep 200;
  127. uiSleep random(300);
  128. _nuTime = (_this select 2) - (time - (_this select 1));
  129. [0,[(_this select 0),_nuTime,"Mil_dot","Asylum Seekers"]] remoteExec ["life_fnc_markers",west];
  130. ["<t align='center'><t size='1'><t size='1.1'><t color='#FF0000'>Asylum Seeker Mission</t></t><br/><t size='.8'>An asylum seeker boat has capsized. Word on the streets is they are getting help from Kamden civilians to gain access to the country. Go get them by boat and bring them back to the boat yard!</t>"] remoteExec["anzmsg",civilian];
  131. ["<t align='center'><t size='1'><t size='1.1'><t color='#FF0000'>Asylum Seeker Mission</t></t><br/><t size='.8'>The police have been notified about the asylum seekers attempting to enter Kamden!</t>"] remoteExec["anzmsg",west];
  132.  
  133. _marker = createMarker ["AsylumSeekerKOS", (_this select 0)];
  134. "AsylumSeekerKOS" setMarkerColor "ColorBlue";
  135. "AsylumSeekerKOS" setMarkerType "Empty";
  136. "AsylumSeekerKOS" setMarkerShape "ELLIPSE";
  137. "AsylumSeekerKOS" setMarkerSize [500,500];
  138. "AsylumSeekerKOS" setMarkerBrush "FDiagonal";
  139. };
  140.  
  141. uiSleep (_timer / 2);
  142. ["<t align='center'><t size='1'><t size='1.1'><t color='#FF0000'>Asylum Seeker Mission</t></t><br/><t size='.8'>Half way through the Asylum Seeker mission.</t>"] remoteExec["anzmsg"];
  143. uiSleep ((_timer / 2) - 60);
  144. ["<t align='center'><t size='1'><t size='1.1'><t color='#FF0000'>Asylum Seeker Mission</t></t><br/><t size='.8'>One more minute until the Asylum Seeker mission is finished!</t>"] remoteExec["anzmsg"];
  145. uiSleep 60;
  146. ["<t align='center'><t size='1'><t size='1.1'><t color='#FF0000'>Asylum Seeker Mission</t></t><br/><t size='.8'>The Asylum Seeker mission has finished!</t>"] remoteExec["anzmsg"];
  147.  
  148. if !(getMarkerColor "AsylumSeekerKOS" isEqualTo "") then
  149. {
  150. "AsylumSeekerKOS" setMarkerAlpha 0;
  151. deleteMarker "AsylumSeekerKOS";
  152. };
  153. [] execVM "\life_server\Functions\Custom\fn_asylumSeekers.sqf";
  154. missionNamespace setVariable ["asylums",false,true];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement