Advertisement
Guest User

spawn.sqf

a guest
Aug 8th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.81 KB | None | 0 0
  1. private ["_counter","_donorBase","_donorUID","_dragee","_findSpot","_isNear","_isZero","_nearPlayers","_position","_seldLoc","_seldRandom","_unit","_waitScript"];
  2.  
  3. cutText ["","BLACK OUT",0];
  4. waitUntil {!dialog};
  5.  
  6. locArray = [
  7. [[4388.23,2263.44,0], [5683.43,3004.63,0], [4517.41,2420.66,0], [5171.99,2070.86,0], [4253.29,2533.43,0]], //Balota
  8. [[11936.1,8870.28,0], [12287.3,8471.17,0], [12263.7,9160.7,0], [11702.7,9172.23,0], [12618.5,9560.67,0]], //Berezino
  9. [[6686.8,2290.11,0], [7235.6,2233.5,0], [6288.59,2574.14,0], [6827.66,3168.46,0], [6960.53,2550.45,0]], //Cherno
  10. [[7067.91,11220.7,0], [7085.3,11522,0], [6733.72,11662.2,0], [6572.46,11495.4,0], [6403.32,11352.8,0]], //Devils
  11. [[10845.3,2701.37,0], [9479.41,1960.8,0], [10497.3,2016.5,0], [10214.1,2411.58,0], [10432.7,2047.76,0]], //Elektro
  12. [[9711.25,8962.2,0], [9756.47,8715.15,0], [9401.49,8953.64,0], [9240.9,8802.83,0], [9867.63,8751.83,0]], //Gorka
  13. [[5939.45,10195.3,0], [6194.16,10372.5,0], [6089.6,10558,0], [5865.1,10132,0], [5296.89,10556,0]], //Grishino
  14. [[8420.79,6643.23,0], [8526.51,6638.72,0], [8402.09,6852.75,0], [8443.92,6490.79,0], [8223.76,6513.61,0]], //Guglovo
  15. [[8812.16,11642,0], [8785.82,11557.9,0], [8577.39,11664.9,0], [8775.45,11734.5,0], [8642.73,11862.9,0]], //Gvozdno
  16. [[5300.83,8547.84,0], [5216.97,8646.67,0], [5294.96,8437.37,0], [5194.68,8584.59,0], [5794.95,8698.89,0]], //Kabanino
  17. [[1244.61,2614.59,0], [1047.04,2268.01,0], [1787.07,2441.89,0], [2030.73,2235.37,0], [1166.07,2299.62,0]], //Kamenka
  18. [[12070.5,3591.06,0], [11972.7,3831.11,0], [11962.1,3567.45,0], [12245.1,3529.93,0], [11929.7,3472.91,0]], //Kamyshovo
  19. [[3608.21,2151.49,0], [3666.51,2642.1,0], [3523.99,2415.42,0], [3468.39,2547.6,0], [3824.01,2589.4,0]], //Komarovo
  20. [[11052.5,12361.2,0], [11764.1,12147.6,0], [12086,11991,0], [10804.7,12483.5,0], [11073.3,12468.8,0]], //Krasnostav
  21. [[13407.3,4175.05,0], [13549.1,4134.78,0], [13457.9,3969.57,0], [13270.3,3957.48,0], [13140,4152.19,0]], //Krutoy
  22. [[2718.47,10093.8,0], [2795.18,9938.02,0], [2885.53,9745.21,0], [2498.82,9624.49,0], [2823.92,9955.97,0]], //Lopatino
  23. [[4983.64,12492,0], [5084.98,12428,0], [4917.56,12554.6,0], [4957.25,12593.5,0], [5220.36,12409,0]], //Petrovka
  24. [[4582.06,6457.02,0], [4736.47,6376.42,0], [4537.43,6382.02,0], [4373.46,6221.47,0], [4785.58,6592.75,0]], //Pogorevka
  25. [[7952.16,3204.92,0], [7699.07,3215.19,0], [7804.76,3554.8,0], [8048.21,3360.93,0], [7445.66,3325.2,0]], //Prigor
  26. [[9153.26,3900.56,0], [9128.73,4106.21,0], [9200.91,3983.34,0], [9147.2,3741.96,0], [9391.94,4077.68,0]], //Pusta
  27. [[13387.5,6617.4,0], [13285,6115.62,0], [13310.1,6331.05,0], [13401.9,5995.73,0], [13513.4,6326.69,0]], //Solnichny
  28. [[3625.72,8976.06,0], [3685.59,8564.4,0], [4197.1,8917.17,0], [3870.38,8997.64,0], [3729.86,8869.19,0]], //Vybor
  29. [[6586.86,6025.5,0], [6526.81,6119.04,0], [6438.74,6203.53,0], [6570.06,6097.29,0], [6576.22,6270.58,0]], //Vyshnoye
  30. [[2692.22,5284.11,0], [2712.73,5068.33,0], [2564.45,4882.19,0], [2602.18,5700.61,0], [2502.53,5549.57,0]] //Zelenogorsk
  31. ];
  32.  
  33. haloSelect = -1;
  34. hidePlayers = [];
  35. spawnSelect = -1;
  36. statusSelect = -2;
  37. _unit = vehicle player;
  38. _dragee = "Survivor1_DZ" createVehicleLocal (getPosASL vehicle player);
  39. _dragee allowDamage false;
  40. _dragee attachTo [_unit,[0.1, 1.01, 0]];
  41.  
  42. _waitScript = [] spawn {
  43. private ["_bodies","_bodyCheck","_bodyPos","_donorBase","_donorUID","_hidePlayers","_i","_idc","_pos"];
  44. _bodyCheck = {
  45. if (ctrlVisible 1001) then {
  46. _donorUID = (getPlayerUID player);
  47. {if (_donorUID == _x) then {_donorBase = _forEachIndex;};} forEach donorListBase;
  48. locArray = locArray+[[(donorListBases select _donorBase)]];
  49. };
  50. _bodies = [];
  51. {if ((_x distance [-18697.58,25815.256,0]) < 15) then {deleteVehicle _x};if (!isNull _x) then {if ((_x getVariable["bodyName",name _x]) == (name player)) then {_bodyPos = (getPosATL _x);_bodies set [count _bodies,_bodyPos];};};} count allDead;
  52. if (count _bodies != 0) then {
  53. {
  54. _bodyPos = _x;
  55. {
  56. _pos = (locArray select _forEachIndex) select 0;
  57. if ((_bodyPos distance _pos) <= 4000) then {
  58. _idc = (1600+_forEachIndex);
  59. ctrlShow [_idc,false];
  60. };
  61. } forEach locArray;
  62. } count _bodies;
  63. if !(ctrlVisible 1624) then {ctrlShow [1001,false];};
  64. };
  65. };
  66. while {statusSelect < 2} do {
  67. dayz_temperatur = 36;
  68. fnc_usec_damageHandler = {};
  69. player_zombieCheck = {};
  70. _hidePlayers = [-18697.58,25815.256,0] nearEntities ["CAManBase", 80];
  71. {if !(_x in hidePlayers) then {hidePlayers set [count hidePlayers,_x];_x hideObject true;};} count _hidePlayers;
  72. uiSleep 1;
  73. if (!dialog) then {
  74. cutText ["","BLACK OUT",0];
  75. if (statusSelect == 0) then {disableUserInput true;disableUserInput true;disableUserInput true;_i="createDialog";createDialog "spawn_dialog";if !((getPlayerUID player) in donorListBase) then {ctrlShow [1001,false];ctrlShow [1624,false];};call _bodyCheck;uiSleep 1;disableUserInput false;disableUserInput false;disableUserInput false;};
  76. if (statusSelect == 1) then {_i="createDialog";createDialog "halo_dialog";};
  77. };
  78. };
  79. };
  80.  
  81. statusSelect = 0;
  82. closeDialog 0;
  83. waitUntil {spawnSelect != -1};
  84. statusSelect = 1;
  85. closeDialog 0;
  86. waitUntil {haloSelect != -1};
  87. statusSelect = 3;
  88. closeDialog 0;
  89. terminate _waitScript;
  90. {_x hideObject false;} count hidePlayers;
  91. hidePlayers = [];
  92. _dragee = [-18697.58,25815.256,0] nearEntities ["Survivor1_DZ",10];
  93. {if (!isNull _x) then {deleteVehicle _x;};} count _dragee;
  94. player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
  95. fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
  96. cutText ["","BLACK IN"];
  97.  
  98. if (spawnSelect == 40) exitWith {
  99. _donorUID = (getPlayerUID player);
  100. {if (_donorUID == _x) then {_donorBase = _forEachIndex;};} forEach donorListBase;
  101. _position = donorListBases select _donorBase;
  102. if (haloSelect == 1) then {player setPosATL [_position select 0,_position select 1,2000];[player,2000] spawn BIS_fnc_halo;} else {player setPosATL _position;};
  103. };
  104. if (spawnSelect == 41) then {spawnSelect = floor (random 23)};
  105.  
  106. _seldLoc = locArray select spawnSelect;
  107. _seldRandom = _seldLoc call BIS_fnc_selectRandom;
  108. _findSpot = true;
  109. _isNear = false;
  110. _counter = 0;
  111. while {_findSpot && _counter < 20} do {
  112. _position = ([_seldRandom,0,700,1,0,20,0] call BIS_fnc_findSafePos);
  113. _nearPlayers = (_position nearEntities ["CAManBase",100]);
  114. {if ((!isNull _x) && (getPlayerUID _x != "")) then {_isNear = true;};} count _nearPlayers;
  115. _isZero = ((_position select 0) == 0) && ((_position select 1) == 0);
  116. _counter = _counter + 1;
  117. if (!_isNear && !_isZero) then {_findSpot = false};
  118. };
  119. _position = [_position select 0,_position select 1,0];
  120. if (haloSelect == 1) then {player setPosATL [_position select 0,_position select 1,2000];[player,2000] spawn BIS_fnc_halo;} else {player setPosATL _position;};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement