Guest User

Untitled

a guest
Feb 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. // Returns true if conditions are met to activate trigger. false if not.
  2. // Compile somewhere: fnc_MyFunc = compile preProcessFileLineNumbers "fnc_myFunc.sqf";
  3. #define MIN_PLAYERS 3
  4.  
  5. if (d_no_more_observers) exitWith { false };
  6. if ({((getposATL _x) select 2) > 3} count _this > 0) exitWith { false }; // Flying vehicles in trigger area, exit.
  7. // Might misunderstand the requirement, perhaps needs to move to the vehicle / player check below?
  8.  
  9. private ["_playerCount"];
  10. _playerCount = 0;
  11. {
  12. if (_x isKindOf "Man") then {
  13. if (isPlayer _x) then { _playerCount = _playerCount + 1 };
  14. } else {
  15. { if (isPlayer _x) then { _playerCount = _playerCount + 1 } } forEach (crew _x);
  16. };
  17. if (_playerCount >= MIN_PLAYERS) exitWith {}; // exit loop scope
  18. } forEach _this;
  19.  
  20. if (_playerCount < MIN_PLAYERS) exitWith { false };
  21.  
  22. true;
Add Comment
Please, Sign In to add comment