controller.sqf 558 B

123456789101112131415161718
  1. infCounter=0;
  2. activated =0;
  3. while {infCounter == 0} do
  4. {
  5. if(activated ==0)then{
  6. alarmController addAction [ "Start Alarm", {alarmController removeAction 0; activated=1; _handle = execVM "alarm.sqf";}];
  7. waitUntil {activated==1};
  8. removeAllActions alarmController;
  9. };
  10. sleep 5;
  11. if(activated ==1)then{
  12. alarmController addAction [ "Stop Alarm", {alarmController removeAction 1; activated=0; missionNamespace getVariable "alarm";
  13. missionNamespace setVariable ["alarm", 1];} ];
  14. waitUntil {activated==0};
  15. removeAllActions alarmController;
  16. };
  17. };