Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.36 KB | None | 0 0
  1. /*
  2. Aroun MCF
  3. init.sqf
  4. */
  5.  
  6. private ["_script","_key"];
  7.  
  8.  
  9.  
  10. Mcf_One_Touche = 0;
  11. _ctrl = _this select 0;
  12. _key = _this select 1;
  13. _shift = _this select 2;
  14. _ctrlKey = _this select 3;
  15. _alt = _this select 4;
  16. _speed = speed cursorTarget;
  17. _handled = false;
  18.  
  19. _interactionKey = if(count (actionKeys "User10") == 0) then {219} else {(actionKeys "User10") select 0};
  20. _mapKey = actionKeys "ShowMap" select 0;
  21. //hint str _code;
  22. _interruptionKeys = [17,30,31,32]; //A,S,W,D
  23. []spawn
  24. {
  25. _pause = time + 1;
  26. waitUntil {time >= _pause};
  27. };
  28. //Vault handling...
  29. if((_code in (actionKeys "GetOver") || _code in (actionKeys "salute")) && {(player getVariable ["restrained",false])}) exitWith {
  30.     true;
  31.     };
  32.     if (isNil "MCF_Action_ON") then {MCF_Action_ON = false;};
  33.     if (isNil "MCF_Stop_Action") then {MCF_Stop_Action = false;};
  34. if(MCF_Action_ON) exitWith {
  35.     if(!MCF_Stop_Action && _code in _interruptionKeys) then {MCF_Stop_Action = true;};
  36.     _handled;
  37. };
  38.  
  39. //Hotfix for Interaction key not being able to be bound on some operation systems.
  40. if(count (actionKeys "User10") != 0 && {(inputAction "User10" > 0)}) exitWith {
  41.     //Interaction key (default is Left Windows, can be mapped via Controls -> Custom -> User Action 10)
  42.     /*
  43.     if(!MCF_Action_ON) then {
  44.         [] spawn
  45.         {
  46.             private["_handle"];
  47.             _handle = [] spawn life_fnc_actionKeyHandler;
  48.             waitUntil {scriptDone _handle};
  49.             MCF_Action_ON = false;
  50.         };
  51.  
  52.     };
  53.     */
  54.     true;
  55. };
  56.    switch (_key) do
  57.         {
  58.         case 57: {
  59.         if(isNil "jumpActionTime") then {jumpActionTime = 0;};
  60.         if(_shift && {animationState player != "AovrPercMrunSrasWrflDf"} && {isTouchingGround player} && {stance player == "STAND"} && {speed player > 2} && {(velocity player) select 2 < 2.5} && {time - jumpActionTime > 1.5}) then {
  61.             jumpActionTime = time; //Update the time.
  62.             [player,true] spawn MCF_fnc_jumpFnc; //Local execution
  63.     //      [player,false] remoteExec ["life_fnc_jumpFnc",0]; //Global execution
  64.             _handled = true;
  65.         };
  66.     };
  67.  
  68.  case 59: {
  69.         if(_shift) then {
  70.             []spawn {
  71.             if (soundVolume != 1 ) then [{
  72.                     1 fadeSound 1;
  73.                     systemChat "Info partie : Audio 100%";
  74.                     sleep 1.5;
  75.                 },{
  76.                     1 fadeSound 0.1;
  77.                     systemChat "Info partie : Audio 10%";
  78.                 }];
  79.             };
  80.         };
  81.     };
  82.  
  83. };
  84. _handled
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement