Guest User

Untitled

a guest
Jan 22nd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. if (isServer) then {
  2.  
  3. // time limit
  4. [] spawn {
  5. sleep (sandi_timeLimit); // 60 minutes
  6. ["sandi_endMission", ["time"]] call CBA_fnc_globalEvent;
  7. };
  8.  
  9. // check for dead teams
  10. if (isMultiplayer) then { // uses playableUnits which only works in MP
  11. [] spawn {
  12. waitUntil {
  13. sleep 5;
  14.  
  15. _isUncon = {
  16. _man = _this select 0;
  17. _uncon = [_man] call ace_sys_wounds_isUncon;
  18. if (isNil "_uncon") then { _uncon = false; };
  19. _uncon
  20. };
  21.  
  22. _countAll = { (isPlayer _x) } count playableUnits;
  23.  
  24. _countWest = { (side _x == west) && (alive _x) && ( (_x distance specPen) > 200) && (isPlayer _x) && !([_x] call _isUncon) } count allUnits;
  25. if (_countWest < (_countAll / 10) ) then {
  26. sleep 1; // allow final death to sync
  27. ["sandi_endMission", ["bluDeaths"]] call CBA_fnc_globalEvent;
  28. };
  29.  
  30. _countEast = { (side _x == east) && (alive _x) && ( (_x distance specPen) > 200) && (isPlayer _x) && !([_x] call _isUncon) } count playableUnits;
  31. if (_countEast < (_countAll / 10) ) then {
  32. sleep 1; // allow final death to sync
  33. ["sandi_endMission", ["redDeaths"]] call CBA_fnc_globalEvent;
  34. };
  35.  
  36. false };
  37. };
  38. };
  39.  
  40. };
Add Comment
Please, Sign In to add comment