Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.92 KB | None | 0 0
  1. span class="re5"> findHouses = {
  2.     private ["_buildings","_minPositions","_enterables","_alive"];
  3.     _buildings = nearestObjects [_this select 0, ["House"], _this select 1];
  4.     _minPositions = (_this select 2) - 1;
  5.     _alive = _this select 3;
  6.  
  7.     _enterables = [];
  8.     {
  9.         if (
  10.             format["%1", _x buildingPos _minPositions] != "[0,0,0]"
  11.         && (alive _x)
  12.         ) then {
  13.             _enterables set [count _enterables, _x];
  14.         };
  15.     } forEach _buildings;
  16.     _enterables
  17. };
  18.  
  19. getGridPos = {
  20.     private ["_pos","_x","_y"];
  21.  
  22.     _pos = getPosATL _this;
  23.     _x = _pos select 0;
  24.     _y = _pos select 1;
  25.     _x = _x - (_x % 100);
  26.     _y = _y - (_y % 100);
  27.     [_x + 50, _y + 50, 0]
  28. };
  29.  
  30. getCurGrid = {
  31.     _gc = player call getGridPos;
  32.     _ngx = _gc select 0;
  33.     _ngy = _gc select 1;
  34.     systemchat format ["%1 %2",_ngx,_ngy];
  35. };
  36.  
  37.  
  38. nearestPlayers = {
  39.     private ["_result","_pos","_range","_type","_alive","_arr"];
  40.     _pos   = _this select 0;
  41.     _range = _this select 1;
  42.     _alive = _this select 2;
  43.     _type  = _this select 3;
  44.  
  45.     if (_type == "count") then { _result = 0; } else { _result = []; };
  46.     {
  47.         if (!isNil _x) then {
  48.             _plr = call compile _x;
  49.             if (!isNull _plr) then {
  50.                 if (_plr distance _pos <= _range && (alive _plr || !_alive)) then {
  51.                     if (_type == "count") then { _result = _result + 1; } else { _result = _result + [_plr]; };
  52.                 };
  53.             };
  54.         };
  55.     } forEach AllPlayers;
  56.     _result
  57. };
  58.  
  59. #define nearestPlayers(W,X,Y,Z) ([W,X,Y,Z] call nearestPlayers)
  60.  
  61. gridClear = {
  62.     private ["_gMkr"];
  63.  
  64.     if (vehicle player != player) exitWith {};
  65.     _gMkr  = str(player call getGridPos);
  66.     if isNil "_gMkr" exitWith {};
  67.     if (markerColor _gMkr == "ColorBLUFOR") exitWith {};
  68.     //WORK
  69.     if ({side group _x == INDEPENDENT} count (allUnits inAreaArray _gMkr) > 0) exitWith {};
  70.     _gMkr setMarkerColor "ColorBLUFOR";
  71.     //_gMkr setMarkerTypeLocal "B_unknown";
  72.     missionNamespace setVariable [format["%1cleared", _gMkr], true];
  73.     publicVariable format["%1cleared", _gMkr];
  74. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement