Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- File: onkeypress.sqf
- Author: itstrap
- Edit: BrezZZz
- Description:
- Executed locally when player press a key.
- Parameters:
- NONE
- For Academy use only! Copy, mirror or use are not allowed! www.Academy-KotH.de
- */
- IF !(alive player) exitWith{ FALSE };
- PRIVATE ["_key", "_shift", "_ctrl", "_alt", "_handled", "_killticker"];
- _key = _this SELECT 1;
- _shift = _this SELECT 2;
- _ctrl = _this SELECT 3;
- _alt = _this SELECT 4;
- _handled = FALSE;
- //hintSilent format["key: %1, shift: %2, ctrl: %3, alt: %4",_key,_shift,_ctrl,_alt];
- // Disable 0..9
- 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 {
- _handled = TRUE;
- };
- switch (TRUE) DO {
- CASE (_key IN actionKeys "ForceCommandingMode" ): {_handled = TRUE;};
- CASE (_key IN actionKeys "SelectAll"): {_handled = TRUE;};
- CASE (_key IN actionKeys "TacticalView" ): {_handled = TRUE;};
- CASE (_key IN actionKeys "Throw" ): {IF (isNil "allowFire") THEN {_handled = TRUE;}};
- // Disable Global Voice
- //CASE ( _key IN actionKeys "PushToTalkSide" );
- //CASE ( _key IN actionKeys "PushToTalkAll" );
- //CASE ( _key IN actionKeys "PushToTalkDirect" );
- //CASE ( _key IN actionKeys "VoiceOverNet" );
- //CASE ( _key IN actionKeys "PushToTalk" ):
- {
- IF ( currentChannel <= 1 ) THEN
- {
- setCurrentChannel 5;
- };
- };
- //CASE (_key IN actionKeys "GetOver") : {
- // IF (!csg_jumping && (primaryWeapon player != "") && (currentWeapon player == primaryWeapon player) && speed player > 5) THEN
- // {
- // [] spawn KOTH_fnc_jump;
- // _handled = TRUE;
- // };
- //};
- };
- // ********** Hardcoded keys **********
- switch (_key) DO
- {
- // 1 FOR primaryWeapon
- CASE 0x02:
- {
- player selectWeapon primaryWeapon player;
- _handled = TRUE;
- };
- // 2 FOR secondaryWeapon
- CASE 0x03:
- {
- player selectWeapon handgunWeapon player;
- _handled = TRUE;
- };
- // 3 FOR secondaryWeapon
- CASE 0x04:
- {
- player selectWeapon secondaryWeapon player;
- _handled = TRUE;
- };
- // H - Holster weapon
- /* case 0x23 :
- {
- if (currentweapon player != "") then
- {
- CSG_Holstered = currentweapon player;
- player action["switchWeapon", player, player, 100];
- player switchCamera cameraView;
- }
- else
- {
- if (CSG_Holstered != "") then{
- player selectWeapon CSG_Holstered;
- };
- };
- _handled = true;
- };
- */
- // Toggle killTicker
- CASE 210 :
- {
- _killTicker = player getVariable "hideticker";
- IF (_killTicker) THEN
- {
- player setVariable["hideticker",FALSE];
- ["AcademyInfo",["Academy-Info","!!!","You turned kill Ticker on!"]] call BIS_fnc_showNotification;
- //["You turned kill Ticker on!","#99ffffff"] call KOTH_fnc_dynamictext;
- ["killFeedOn",TRUE] call enableFunction;
- }
- ELSE
- {
- player setVariable["hideticker",TRUE];
- ["AcademyInfo",["Academy-Info","!!!","You turned kill Ticker off!"]] call BIS_fnc_showNotification;
- //["You turned kill Ticker off!","#99ffffff"] call KOTH_fnc_dynamictext;
- ["killFeedOn",FALSE] call enableFunction;
- };
- _handled = TRUE;
- };
- // Home / Pos1 - Info Menu
- CASE 0xC7:
- {
- IF (!IsNull (FindDisplay 2501)) THEN
- {
- closeDialog 2501;
- } ELSE
- {
- call academy_fnc_OpenInfoUI;
- };
- _handled = TRUE;
- };
- };
- _handled
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement