Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. _objAmount = [_this, 0, 1, [0]] call BIS_fnc_Param;
  2. _objType = [_this, 1, "and", [""]] call BIS_fnc_Param; //"or" and "and"
  3.  
  4. hint format["%1 for %2 obj's", _objType,_objAmount];
  5.  
  6. //convert objective type to lowercase to compare
  7. if(tolower(_objType) == "or") then {
  8. [] spawn { while {!ASORET_objComplete } do {
  9. _complete = false;
  10. for[{_i = 0}, {_i < _objAmount}, {_i = _i + 1}] do {
  11. //it's already marked as complete, or this objective is complete
  12. _complete = _complete || (missionNamespace getVariable [format["ASORET_obj%1", (_i+1)], false]);
  13. };
  14. ASORET_objComplete = _complete;
  15. hint format["Loop Complete OBJ %1",_complete];
  16. sleep 20;
  17. };
  18. } else {
  19. [] spawn { while {!ASORET_objComplete } do {
  20. _complete = true;
  21. for[{_i = 0}, {_i < _objAmount}, {_i = _i + 1}] do {
  22. //it's already marked as complete and this objective is complete
  23. _complete = _complete && (missionNamespace getVariable [format["ASORET_obj%1", (_i+1)], false]);
  24. };
  25. ASORET_objComplete = _complete;
  26. hint format["Loop Complete OBJ %1",_complete];
  27. sleep 20;
  28. };
  29. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement