rendered paste bodyif (isServer) then {
_pos = _this select 0;
_radius = _this select 1;
_objectiveIndex = 0;
if (isNil "objectives") then {
objectives = [0];
} else {
objectives = objectives + [0];
_objectiveIndex = (count objectives) -1;
};
_westCap = 10;
_eastCap = -10;
_isUncon = {
_man = _this select 0;
_uncon = [_man] call ace_sys_wounds_isUncon;
if (isNil "_uncon") then { _uncon = false; };
_uncon
};
waitUntil {
_return = false;
sleep 10;
_countWest = { (_x getVariable ["sandi_framework_side", side player] == west) && ((_x distance _pos) < _radius) && (alive _x) && !([_x] call _isUncon) } count allUnits;
_countEast = { (_x getVariable ["sandi_framework_side", side player] == east) && ((_x distance _pos) < _radius) && (alive _x) && !([_x] call _isUncon) } count allUnits;
if ( (_countWest >= 2) && (_countEast == 0) && ((objectives select _objectiveIndex) < _westCap) ) then {
objectives set [_objectiveIndex, (objectives select _objectiveIndex) +1];
if ((objectives select _objectiveIndex) == _westCap) then {
_win = true;
{
if (_x != _westCap) then {
_win = false;
};
} foreach objectives;
if (_win) then {
// end mission west win
};
};
};
if ( (_countEast >= 2) && (_countWest == 0) && (objectives select _objectiveIndex) > _eastCap) then {
objectives set [_objectiveIndex, (objectives select _objectiveIndex) -1];
if ((objectives select _objectiveIndex) == _eastCap) then {
_win = true;
{
if (_x != _eastCap) then {
_win = false;
};
} foreach objectives;
if (_win) then {
// end mission east win
};
};
};
if (_points >= 10) then { // 300 seconds
};
_return};
};