Advertisement
Guest User

Untitled

a guest
Aug 9th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 3.25 KB | None | 0 0
  1. /*
  2.     File: onkeypress.sqf
  3.     Author: itstrap
  4.     Edit: BrezZZz
  5.    
  6.     Description:
  7.         Executed locally when player press a key.
  8.     Parameters:
  9.         NONE
  10.        
  11.     For Academy use only! Copy, mirror or use are not allowed! www.Academy-KotH.de
  12. */
  13. IF !(alive player) exitWith{ FALSE };
  14. PRIVATE ["_key", "_shift", "_ctrl", "_alt", "_handled", "_killticker"];
  15.  
  16. _key    = _this SELECT 1;
  17. _shift  = _this SELECT 2;
  18. _ctrl   = _this SELECT 3;
  19. _alt    = _this SELECT 4;
  20.  
  21. _handled = FALSE;
  22. //hintSilent format["key: %1, shift: %2, ctrl: %3, alt: %4",_key,_shift,_ctrl,_alt];
  23.  
  24. // Disable 0..9
  25. IF (_key IN[0x02,0x03,0x04,0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) THEN {
  26.     _handled = TRUE;
  27. };
  28.  
  29. switch (TRUE) DO {
  30.     CASE (_key IN actionKeys "ForceCommandingMode" ): {_handled = TRUE;};
  31.     CASE (_key IN actionKeys "SelectAll"): {_handled = TRUE;};
  32.     CASE (_key IN actionKeys "TacticalView" ): {_handled = TRUE;};
  33.     CASE (_key IN actionKeys "Throw" ): {IF (isNil "allowFire") THEN {_handled = TRUE;}};
  34.    
  35.     // Disable Global Voice
  36.     //CASE ( _key IN actionKeys "PushToTalkSide" );
  37.     //CASE ( _key IN actionKeys "PushToTalkAll" );
  38.     //CASE ( _key IN actionKeys "PushToTalkDirect" );
  39.     //CASE ( _key IN actionKeys "VoiceOverNet" );
  40.     //CASE ( _key IN actionKeys "PushToTalk" ):
  41.     {
  42.         IF ( currentChannel <= 1 ) THEN
  43.         {
  44.             setCurrentChannel 5;
  45.         };
  46.     }; 
  47.     //CASE (_key IN actionKeys "GetOver") : {
  48.     //  IF (!csg_jumping && (primaryWeapon player != "") && (currentWeapon player == primaryWeapon player) && speed player > 5) THEN
  49.     //  {
  50.     //      [] spawn KOTH_fnc_jump;
  51.     //      _handled = TRUE;
  52.     //  };
  53.     //};
  54. };
  55. // ********** Hardcoded keys **********
  56. switch (_key) DO
  57. {
  58.     // 1 FOR primaryWeapon
  59.     CASE 0x02:
  60.     {
  61.         player selectWeapon primaryWeapon player;
  62.         _handled = TRUE;
  63.     };
  64.     // 2 FOR secondaryWeapon
  65.     CASE 0x03:
  66.     {
  67.         player selectWeapon handgunWeapon player;
  68.         _handled = TRUE;
  69.     };
  70.     // 3 FOR secondaryWeapon
  71.     CASE 0x04:
  72.     {
  73.         player selectWeapon secondaryWeapon player;
  74.         _handled = TRUE;
  75.     };
  76.  
  77.     // H - Holster weapon
  78. /*  case 0x23 :
  79.     {
  80.         if (currentweapon player != "") then
  81.         {
  82.             CSG_Holstered = currentweapon player;
  83.             player action["switchWeapon", player, player, 100];
  84.             player switchCamera cameraView;
  85.         }
  86.         else
  87.         {
  88.             if (CSG_Holstered != "") then{
  89.                 player selectWeapon CSG_Holstered;
  90.             };
  91.         };
  92.         _handled = true;
  93.     };
  94. */
  95.     // Toggle killTicker
  96.     CASE 210 :
  97.     {
  98.         _killTicker = player getVariable "hideticker";
  99.         IF (_killTicker) THEN
  100.         {
  101.             player setVariable["hideticker",FALSE];
  102.             ["AcademyInfo",["Academy-Info","!!!","You turned kill Ticker on!"]] call BIS_fnc_showNotification;
  103.             //["You turned kill Ticker on!","#99ffffff"] call KOTH_fnc_dynamictext;
  104.             ["killFeedOn",TRUE] call enableFunction;
  105.         }
  106.         ELSE
  107.         {
  108.             player setVariable["hideticker",TRUE];
  109.             ["AcademyInfo",["Academy-Info","!!!","You turned kill Ticker off!"]] call BIS_fnc_showNotification;        
  110.             //["You turned kill Ticker off!","#99ffffff"] call KOTH_fnc_dynamictext;
  111.             ["killFeedOn",FALSE] call enableFunction;
  112.         };
  113.         _handled = TRUE;
  114.     };
  115.  
  116.      // Home / Pos1 - Info Menu
  117.     CASE 0xC7:
  118.     {
  119.         IF (!IsNull (FindDisplay 2501)) THEN
  120.             {
  121.                 closeDialog 2501;
  122.             } ELSE
  123.     {
  124.     call academy_fnc_OpenInfoUI;
  125.     };
  126.     _handled = TRUE;
  127.     };
  128.  
  129.  
  130. };
  131. _handled
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement