Advertisement
Guest User

Untitled

a guest
Dec 16th, 2013
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 6.43 KB | None | 0 0
  1. private ["_dikCode","_handled","_primaryWeapon","_secondaryWeapon","_nearbyObjects","_nill","_shift","_ctrl","_alt","_dropPrimary","_dropSecondary","_iItem","_removed","_iPos","_radius","_item"];
  2. _dikCode =  _this select 1;
  3.  
  4. _handled = false;
  5.  
  6. if (_dikCode in[0x02,0x03,0x04,0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x3B,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) then {
  7.     _handled = true;
  8. };
  9.  
  10. if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3)) then {
  11.     if(diag_tickTime - dayz_lastCheckBit > 10) then {
  12.         dayz_lastCheckBit = diag_tickTime;
  13.         call dayz_forceSave;
  14.     };
  15.     call dayz_EjectPlayer;
  16. };
  17.  
  18. // esc
  19. if (_dikCode == 0x01) then {
  20.     DZE_cancelBuilding = true;
  21.     call dayz_EjectPlayer;
  22. };
  23.  
  24. // surrender
  25. if (_dikCode in actionKeys "Surrender") then {
  26.    
  27.     _vehicle = vehicle player;
  28.     _inVehicle = (_vehicle != player);
  29.     _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  30.     _canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder and !_inVehicle);
  31.    
  32.     if (_canDo and !DZE_Surrender and !(player isKindOf  "PZombie_VB")) then {
  33.         DZE_Surrender = true;
  34.         _dropPrimary = false;
  35.         _dropSecondary = false;
  36.  
  37.         _primaryWeapon = primaryWeapon player;
  38.         if (_primaryWeapon != "") then {_dropPrimary = true;};
  39.         _secondaryWeapon = "";
  40.         {
  41.             if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Type")) == 2) exitWith {
  42.                     _secondaryWeapon = _x;
  43.             };
  44.         } forEach (weapons player);
  45.         if (_secondaryWeapon != "") then {_dropSecondary = true;};
  46.  
  47.         if (_dropPrimary or _dropSecondary) then {
  48.             player playActionNow "PutDown";
  49.             _iPos = getPosATL player;
  50.             _radius = 1;
  51.             _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
  52.             _item setposATL _iPos;
  53.             if (_dropPrimary) then {
  54.                 _iItem = _primaryWeapon;
  55.                 _removed = ([player,_iItem,1] call BIS_fnc_invRemove);
  56.                 if (_removed == 1) then {
  57.                     _item addWeaponCargoGlobal [_iItem,1];
  58.                 };
  59.             };
  60.             if (_dropSecondary) then {
  61.                 _iItem = _secondaryWeapon;
  62.                 _removed = ([player,_iItem,1] call BIS_fnc_invRemove);
  63.                 if (_removed == 1) then {
  64.                     _item addWeaponCargoGlobal [_iItem,1];
  65.                 };
  66.             };
  67.             player reveal _item;
  68.         };
  69.  
  70.         // set publicvariable that allows other player to access gear
  71.         player setVariable ["DZE_Surrendered", true, true];
  72.         // surrender animation
  73.         player playMove "AmovPercMstpSsurWnonDnon";
  74.     };
  75.     _handled = true;
  76. };
  77.  
  78. if (_dikCode in actionKeys "MoveForward") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
  79. if (_dikCode in actionKeys "MoveLeft") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
  80. if (_dikCode in actionKeys "MoveRight") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
  81. if (_dikCode in actionKeys "MoveBack") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
  82.  
  83. //Prevent exploit of drag body
  84. if ((_dikCode in actionKeys "Prone") and r_drag_sqf) exitWith { force_dropBody = true; };
  85. if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) exitWith { force_dropBody = true; };
  86.  
  87. _shift =    _this select 2;
  88. _ctrl =     _this select 3;
  89. _alt =      _this select 4;
  90.  
  91. //diag_log format["Keypress: %1", _this];
  92. if ((_dikCode in actionKeys "Gear") and (vehicle player != player) and !_shift and !_ctrl and !_alt && !dialog) then {
  93.             createGearDialog [player, "RscDisplayGear"];
  94.             _handled = true;
  95. };
  96.  
  97. if (_dikCode in (actionKeys "GetOver")) then {
  98.    
  99.     if (player isKindOf  "PZombie_VB") then {
  100.         _handled = true;
  101.         DZE_PZATTACK = true;
  102.     } else {
  103.         _nearbyObjects = nearestObjects[getPosATL player, dayz_disallowedVault, 8];
  104.         if (count _nearbyObjects > 0) then {
  105.             if((diag_tickTime - dayz_lastCheckBit > 4)) then {
  106.                 [objNull, player, rSwitchMove,"GetOver"] call RE;
  107.                 player playActionNow "GetOver";
  108.                 dayz_lastCheckBit = diag_tickTime;
  109.             } else {
  110.                 _handled = true;
  111.             };
  112.         };
  113.     };
  114. };
  115. //if (_dikCode == 57) then {_handled = true}; // space
  116. //if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
  117. if (_dikCode == 210) then {
  118.         _nill = execvm "custom\playerstats.sqf";
  119. };
  120.  
  121. if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
  122. if (_dikCode in actionKeys "PushToTalk" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
  123.     dayz_lastCheckBit = diag_tickTime;
  124.     [player,50,true,(getPosATL player)] spawn player_alertZombies;
  125. };
  126. if (_dikCode in actionKeys "VoiceOverNet" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
  127.     dayz_lastCheckBit = diag_tickTime;
  128.     [player,50,true,(getPosATL player)] spawn player_alertZombies;
  129. };
  130. if (_dikCode in actionKeys "PushToTalkDirect" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
  131.     dayz_lastCheckBit = diag_tickTime;
  132.     [player,15,false,(getPosATL player)] spawn player_alertZombies;
  133. };
  134. if (_dikCode in actionKeys "Chat" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
  135.     dayz_lastCheckBit = diag_tickTime;
  136.     [player,15,false,(getPosATL player)] spawn player_alertZombies;
  137. };
  138. if (_dikCode in actionKeys "User20" and (diag_tickTime - dayz_lastCheckBit > 5)) then {
  139.     dayz_lastCheckBit = diag_tickTime;
  140.     _nill = execvm "custom\playerstats.sqf";
  141. };
  142.  
  143. // numpad 8 0x48 now pgup 0xC9 1
  144. if ((_dikCode == 0xC9 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User15")) then {
  145.     DZE_Q = true;
  146. };
  147. // numpad 2 0x50 now pgdn 0xD1
  148. if ((_dikCode == 0xD1 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User16")) then {
  149.     DZE_Z = true;
  150. };
  151.  
  152.  
  153. // numpad 8 0x48 now pgup 0xC9 0.1
  154. if ((_dikCode == 0xC9 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User13")) then {
  155.     DZE_Q_alt = true;
  156. };
  157. // numpad 2 0x50 now pgdn 0xD1
  158. if ((_dikCode == 0xD1 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User14")) then {
  159.     DZE_Z_alt = true;
  160. };
  161.  
  162.  
  163. // numpad 8 0x48 now pgup 0xC9 0.01
  164. if ((_dikCode == 0xC9 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User7")) then {
  165.     DZE_Q_ctrl = true;
  166. };
  167. // numpad 2 0x50 now pgdn 0xD1
  168. if ((_dikCode == 0xD1 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User8")) then {
  169.     DZE_Z_ctrl = true;
  170. };
  171.  
  172.  
  173.  
  174.  
  175. // numpad 4 0x4B now Q 0x10
  176. if (_dikCode == 0x10 or (_dikCode in actionKeys "User17")) then {
  177.     DZE_4 = true;
  178. };     
  179. // numpad 6 0x4D now E 0x12
  180. if (_dikCode == 0x12 or (_dikCode in actionKeys "User18")) then {
  181.     DZE_6 = true;
  182. };
  183. // numpad 5 0x4C now space 0x39
  184. if (_dikCode == 0x39 or (_dikCode in actionKeys "User19")) then {
  185.     DZE_5 = true;
  186. };
  187.  
  188. _handled
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement