Advertisement
Guest User

fnc_initCounter.sqf

a guest
Feb 9th, 2014
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. private ["_mode", "_activationCount", "_maxCount", "_timesActivated", "_keyString"];
  2. _mode = _this;
  3. _activationCount = 4;
  4. _maxCount = 25;
  5. _timesActivated = 1;
  6. _keyString = "BIS_IAmBeingNaughty";
  7.  
  8. for "_i" from 1 to (_maxCount - 1) do
  9. {
  10. if (isKeyActive (_keyString + (str _i))) then
  11. {
  12. _timesActivated = _timesActivated + 1
  13. };
  14. };
  15.  
  16. if (_mode) then
  17. {
  18. if (_timesActivated <= _maxCount) then
  19. {
  20. activateKey (_keyString + (str _timesActivated));
  21. };
  22.  
  23. if (_timesActivated >= _activationCount) then
  24. {
  25. private ["_handle"];
  26. _handle = [_timesActivated] execVM "ca\modules\functions\systems\fn_enableSystem.sqf";
  27.  
  28. if ((random 5) < 1) then
  29. {
  30. _handle = [_timesActivated] execVM "ca\modules\functions\systems\fn_enableAnotherSystem.sqf";
  31. };
  32. };
  33. }
  34. else
  35. {
  36. if ((configName (configFile >> "CfgPatches" >> "CA_E")) != "") then
  37. {
  38. for "_i" from 1 to (_timesActivated - 1) do
  39. {
  40. call (compile "deactivateKey (_keyString + (str _i))");
  41. };
  42. };
  43. };
  44.  
  45. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement