Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_isIsland","_pos","_findSpot","_mkr","_position","_isNear","_isZero","_counter","_DRNLocs","_DRNloc"];
- _DRNLocs = [
- //Sabina
- [[15381.7,8395.57,87.6772], [16472.3,9163.9,119.374], [16037.2,10031.2,36.1822], [14472.9,10700.6,21.4281], [14493.7,9200.24,126.867]],
- //Yaroslav
- [[11684.3,18379.2,46.0772], [10158.6,17676.4,90.3028], [10454.7,19612.3,56.9962], [9402.78,15928.5,105.941], [10450.7,19417.3,61.5052]],
- //Seven
- [[10183.8,1541.89,26.493], [10807.8,1100.28,27.3607], [11404,806.905,23.4282], [11521.4,1606.74,48.3487], [9198.37,2514.65,28.741]],
- //Shtangrad
- [[1528.68,7270.51,36.3004], [3122.7,6819.02,81.765], [4703.43,6447.21,37.6225], [4101.24,7890.2,36.6137], [4721.14,7146.57,287.936]]
- ];
- drnspawn = -1;
- cutText ["","BLACK OUT"];
- _ok = createDialog "DRN_DIALOG";
- waitUntil { drnspawn != -1};
- if (drnspawn == 4) then {drnspawn = floor (random 4)};
- _DRNloc = _DRNLocs select drnspawn;
- //Spawn modify via mission init.sqf
- if(isnil "spawnArea") then {
- spawnArea = 1500;
- };
- if(isnil "spawnShoremode") then {
- spawnShoremode = 1;
- };
- //spawn into random
- _findSpot = true;
- _mkr = "";
- while {_findSpot} do {
- _counter = 0;
- while {_counter < 20 and _findSpot} do {
- // switched to floor
- _mkr = _DRNLoc select(floor(random (count _DRNLoc)));
- _position = ([(_mkr),0,spawnArea,10,0,2000,spawnShoremode] call BIS_fnc_findSafePos);
- _isNear = count (_position nearEntities ["Man",100]) == 0;
- _isZero = ((_position select 0) == 0) and ((_position select 1) == 0);
- //Island Check
- _pos = _position;
- _isIsland = false; //Can be set to true during the Check
- for [{_w=0},{_w<=150},{_w=_w+2}] do {
- _pos = [(_pos select 0),((_pos select 1) + _w),(_pos select 2)];
- if(surfaceisWater _pos) exitWith {
- _isIsland = true;
- };
- };
- if ((_isNear and !_isZero) || _isIsland) then {_findSpot = false};
- _counter = _counter + 1;
- };
- };
- _isZero = ((_position select 0) == 0) and ((_position select 1) == 0);
- _position = [_position select 0,_position select 1,0];
- diag_log("DEBUG: spawning new player at" + str(_position));
- if (!_isZero) then {
- player setPosATL _position;
- };
- cutText ["","BLACK IN"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement