Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. private ["_DZE_safeZonePosArray","_customPosition","_customRadius","_maxDist","_nearVehicles","_objDist","_position","_safeZonePos","_safeZoneRadius","_useCustomPosition"];
  2.  
  3. _useCustomPosition = false; // Enable a custom position to move vehicles to (i.e a junk yard)
  4. _customPosition = [6942.64,15121.6,0]; // Position for vehicles to be moved to if _useCustomPosition = true;
  5. _customRadius = 150; // Minimum distance from the custom position to move vehicles to
  6. _maxDist = 600; // Maximum distance from the safe zone position to find a safe position or custom position for relocation, setting this too low can make vehicles spawn very close to other vehicles.
  7. _objDist = 15; // Minimum distance from the safe position for relocation to the center of the nearest object. Specifying quite a large distance here will slow the function and might often fail to find a suitable position.
  8. _DZE_safeZonePosArray = [
  9.  
  10. [[3965.6555, 2357.6074,0],30],//detention
  11. [[3814.6487, 5661.3838,0],50],//sisters
  12. [[8584.3291, 2005.4772, 0],50],//enola
  13. [[3062.4978, 8048.4341, 0],80],//refugee
  14. [[3505.8303, 5778.3496,0],120]//central
  15.  
  16. ];
  17.  
  18. {
  19. _safeZonePos = _x select 0;
  20. _safeZoneRadius = _x select 1;
  21. _nearVehicles = _safeZonePos nearEntities [["Air","LandVehicle","Ship"],_safeZoneRadius];
  22. {
  23. if (_useCustomPosition) then {
  24. _position = [_customPosition,_customRadius,_maxDist,_objDist,1,0,0,[]] call BIS_fnc_findSafePos;
  25. } else {
  26. _position = [_safeZonePos,_safeZoneRadius + 50,_maxDist,_objDist,if (_x isKindOf "Ship") then {2} else {0},0,0,[],[_safeZonePos,_safeZonePos]] call BIS_fnc_findSafePos;
  27. };
  28. _x setPos _position;
  29. [_x,"position"] call server_updateObject;
  30.  
  31. diag_log format ["[SAFEZONE] %1 was moved out of a safe zone to: @%2 %3",typeOf _x,mapGridPosition _position,_position];
  32. } forEach _nearVehicles;
  33. } forEach _DZE_safeZonePosArray;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement