Advertisement
TaktischerSpeck

Untitled

Mar 19th, 2020
1,319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 23.58 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. *    File: fn_keyHandler.sqf
  4. *    Author: Bryan "Tonic" Boardwine
  5. *
  6. *    Description:
  7. *    Main key handler for event 'keyDown'.
  8. */
  9.  
  10. params [
  11.     "_ctrl",
  12.     "_code",
  13.     "_shift",
  14.     "_ctrlKey",
  15.     "_alt"
  16. ];
  17.  
  18. private _speed = speed cursorObject;
  19. private _handled = false;
  20. private _interactionKey = if (actionKeys "User10" isEqualTo []) then {219} else {(actionKeys "User10") select 0};
  21. private _interruptionKeys = [17, 30, 31, 32]; //A,S,W,D
  22.  
  23. //Vault handling...
  24. if ((_code in (actionKeys "GetOver") || _code in (actionKeys "salute") || _code in (actionKeys "SitDown") || _code in (actionKeys "Throw") || _code in (actionKeys "GetIn") || _code in (actionKeys "GetOut") || _code in (actionKeys "Fire") || _code in (actionKeys "ReloadMagazine") || _code in [16,18]) && ((player getVariable ["restrained",false]) || (player getVariable ["ziptied",false]) || life_isknocked || life_istazed)) exitWith {
  25.     true;
  26. };
  27.  
  28. if (life_action_inUse) exitWith {
  29.     if (!life_interrupted && _code in _interruptionKeys) then {life_interrupted = true};
  30.     _handled;
  31. };
  32.  
  33. //Hotfix for Interaction key not being able to be bound on some operation systems.
  34. if (!(actionKeys "User10" isEqualTo []) && {(inputAction "User10" > 0)}) exitWith {
  35.     //Interaction key (default is Left Windows, can be mapped via Controls -> Custom -> User Action 10)
  36.     if (!life_action_inUse) then {
  37.         [] spawn {
  38.             private _handle = [] spawn life_fnc_actionKeyHandler;
  39.             waitUntil {scriptDone _handle};
  40.             life_action_inUse = false;
  41.         };
  42.     };
  43.     true;
  44. };
  45.  
  46. if (life_container_active) exitwith {
  47.     //ignore movement actions
  48.     private _allowedMoves = [
  49.         "MoveForward",
  50.         "MoveBack",
  51.         "TurnLeft",
  52.         "TurnRight",
  53.         "MoveFastForward",
  54.         "MoveSlowForward",
  55.         "turbo",
  56.         "TurboToggle",
  57.         "MoveLeft",
  58.         "MoveRight",
  59.         "WalkRunTemp",
  60.         "WalkRunToggle",
  61.         "AdjustUp",
  62.         "AdjustDown",
  63.         "AdjustLeft",
  64.         "AdjustRight",
  65.         "Stand",
  66.         "Crouch",
  67.         "Prone",
  68.         "MoveUp",
  69.         "MoveDown",
  70.         "LeanLeft",
  71.         "LeanLeftToggle",
  72.         "LeanRight",
  73.         "LeanRightToggle"
  74.     ];
  75.     if (({_code in (actionKeys _x)} count _allowedMoves) > 0) exitwith {
  76.         false;
  77.     };
  78.     //handle other keys
  79.     if (_code isEqualTo 57) then {//space key -> place
  80.         life_storagePlacing = 0 spawn life_fnc_placestorage;
  81.     } else { //other keys -> abort
  82.         if (!isNull life_storagePlacing) exitWith {}; //already placing down a box
  83.         if (!isNull life_container_activeObj) then {
  84.             deleteVehicle life_container_activeObj;
  85.             titleText [localize "STR_NOTF_PlaceContainerAbort", "PLAIN"];
  86.         };
  87.         life_container_active = false;
  88.     };
  89.     true;
  90. };
  91.  
  92. /*      AAPPS - KEYMAPPER       */
  93. //Interaction key (default is Left Windows, can be mapped via Controls -> Custom -> User Action 10)
  94. if(_code isEqualTo _interactionKey) exitWith {
  95.     if (!life_action_inUse) then {
  96.         [] spawn  {
  97.             private "_handle";
  98.             _handle = [] spawn life_fnc_actionKeyHandler;
  99.             waitUntil {scriptDone _handle};
  100.             life_action_inUse = false;
  101.         };
  102.     };
  103.     true
  104. };
  105.  
  106. private _CommandMode = actionKeys "tacticalView";
  107.  
  108. if (_code in _CommandMode) then {
  109.     hint localize "STR_NOTF_CommanderView";
  110.     true
  111. };
  112.  
  113. _sca = [parseNumber _shift,parseNumber _ctrlKey,parseNumber _alt];
  114. if(dialog) exitWith {false};
  115. _found = false;
  116. {
  117.     if(((_x select 1) isEqualTo _code) && {_sca isEqualTo (_x select 2)}) exitWith {
  118.         _code = _x select 0;
  119.         _found = true;
  120.     };
  121. } forEach keymapper_saved_keys;
  122. if(!_found) exitWith {false};
  123. /*      END OF AAPPS - KEYMAPPER        */
  124.  
  125. switch (_code) do {
  126.  
  127.     //Skin Reload
  128.     case 1: {
  129.         [] call life_fnc_hudUpdate;
  130.         [] call life_fnc_playerSkins;
  131.     };
  132.  
  133.     //Nitro
  134.     case 2: {
  135.         if (((vehicle player) getVariable["nitro", 0]) > 0) then {
  136.             [] spawn {
  137.                 [] call life_fnc_useNitro;
  138.                 sleep 2.5;
  139.             };
  140.         };
  141.     };
  142.  
  143.     //Geste
  144.     case 3: {
  145.         if !(player getVariable ["restrained", false]) then {
  146.             player playActionNow "gestureHi";
  147.         };        
  148.     };
  149.  
  150.     //Redgull
  151.     case 4: {
  152.         if([false,"redgull",1] call life_fnc_handleInv) then{
  153.             [] spawn {
  154.                 life_redgull_effect = time;
  155.                 ["Du kannst jetzt für 3 Minuten weiter laufen",false,"fast"] call life_fnc_notification_system;
  156.                 player enableFatigue false;
  157.                 waitUntil {!alive player OR ((time - life_redgull_effect) > (3 * 60))};
  158.                 player enableFatigue true;
  159.             };
  160.         } else {
  161.             [] spawn {
  162.                 ["Du hast kein RedGull",true,"fast"] call life_fnc_notification_system;
  163.                 sleep 2.5;
  164.             };
  165.         };
  166.     };
  167.  
  168.     //Restrain Cop
  169.     case 5: {
  170.         if (!isNull cursorObject && {cursorObject isKindOf "Man"} && {(isPlayer cursorObject)} && {(side cursorObject in [civilian,independent])} && {alive cursorObject} && {cursorObject distance player < 3.5} && {!(cursorObject getVariable "Escorting")} && {!(cursorObject getVariable "restrained")} && {speed cursorObject < 1}) then {
  171.             [] call life_fnc_restrainAction;
  172.         };
  173.     };
  174.  
  175.     //Restrain Civ
  176.     case 6: {
  177.         [] call zipties_fnc_zip_tieAction;
  178.     };
  179.  
  180.     //Kofferraum
  181.     case 7: {
  182.         if (!dialog && {!life_action_inUse} && {!(player getVariable ["playerSurrender",false])} && {!(player getVariable ["restrained",false])} && {!life_isknocked} && {!life_istazed}) then {
  183.             if (!(isNull objectParent player) && alive vehicle player) then {
  184.                 if ((vehicle player) in life_vehicles) then {
  185.                     ["life_fnc_openInventory", [vehicle player]] call AD_fnc_ping;
  186.                 };
  187.             } else {
  188.                 private "_list";
  189.                 _list = ((ASLtoATL (getPosASL player)) nearEntities [["Box_IND_Grenades_F","B_supplyCrate_F","Box_NATO_WpsSpecial_F"], 2.5]) select 0;
  190.                 if (!(isNil "_list")) then {
  191.                     _house = nearestObject [(ASLtoATL (getPosASL _list)), "House"];
  192.                     if (_house getVariable ["locked", false]) then {
  193.                         [ localize "STR_House_ContainerDeny",true,"fast"] call life_fnc_notification_system;
  194.                     } else {
  195.                         ["life_fnc_openInventory", [_list]] call AD_fnc_ping;
  196.                     };
  197.                 } else {
  198.                     _list = ["landVehicle","Air","Ship"];
  199.                     if (KINDOF_ARRAY(cursorObject,_list) && {player distance cursorObject < 7} && {isNull objectParent player} && {alive cursorObject} && {!life_action_inUse}) then {
  200.                         if (cursorObject in life_vehicles || {locked cursorObject isEqualTo 0}) then {
  201.                             ["life_fnc_openInventory", [cursorObject]] call AD_fnc_ping;
  202.                         };
  203.                     };
  204.                 };
  205.             };
  206.         };
  207.     };
  208.  
  209.     //Z Menü
  210.     case 8: {
  211.         if (!dialog && !(player getVariable ["ziptied",false]) && !(player getVariable ["restrained",false]) && {!life_action_inUse}) then {
  212.             [] call life_fnc_p_openMenu;
  213.             [] call life_fnc_hudUpdate;
  214.             [] call life_fnc_playerSkins;
  215.         };
  216.     };
  217.  
  218.     //Aufschließen / Abschließen
  219.     case 9: {
  220.         private _veh = if (isNull objectParent player) then {
  221.             cursorObject;
  222.         } else {
  223.             vehicle player;
  224.         };
  225.  
  226.         if (_veh isKindOf "House_F" && {playerSide isEqualTo civilian}) then {
  227.             if (_veh in life_vehicles && {player distance _veh < 20}) then {
  228.                 private _door = [_veh] call life_fnc_nearestDoor;
  229.                 if (_door isEqualTo 0) exitWith {[ localize "STR_House_Door_NotNear",true,"fast"] call life_fnc_notification_system;};
  230.                 private _locked = _veh getVariable [format ["bis_disabled_Door_%1",_door],0];
  231.  
  232.                 if (_locked isEqualTo 0) then {
  233.                 _veh setVariable [format ["bis_disabled_Door_%1",_door],1,true];
  234.                 _veh animateSource [format ["Door_%1_source", _door], 0];
  235.                 systemChat localize "STR_House_Door_Lock";
  236.                 } else {
  237.                 _veh setVariable [format ["bis_disabled_Door_%1",_door],0,true];
  238.                 _veh animateSource [format ["Door_%1_source", _door], 1];
  239.                 systemChat localize "STR_House_Door_Unlock";
  240.                 };
  241.             };
  242.         } else {
  243.             private _locked = locked _veh;
  244.             if (_veh in life_vehicles && {player distance _veh < 20}) then {
  245.                 if (_locked isEqualTo 2) then {
  246.                 if (local _veh) then {
  247.                     _veh lock 0;
  248.  
  249.                     // BI
  250.                     _veh animateDoor ["door_back_R",1];
  251.                     _veh animateDoor ["door_back_L",1];
  252.                     _veh animateDoor ['door_R',1];
  253.                     _veh animateDoor ['door_L',1];
  254.                     _veh animateDoor ['Door_L_source',1];
  255.                     _veh animateDoor ['Door_rear',1];
  256.                     _veh animateDoor ['Door_rear_source',1];
  257.                     _veh animateDoor ['Door_1_source',1];
  258.                     _veh animateDoor ['Door_2_source',1];
  259.                     _veh animateDoor ['Door_3_source',1];
  260.                     _veh animateDoor ['Door_LM',1];
  261.                     _veh animateDoor ['Door_RM',1];
  262.                     _veh animateDoor ['Door_LF',1];
  263.                     _veh animateDoor ['Door_RF',1];
  264.                     _veh animateDoor ['Door_LB',1];
  265.                     _veh animateDoor ['Door_RB',1];
  266.                     _veh animateDoor ['DoorL_Front_Open',1];
  267.                     _veh animateDoor ['DoorR_Front_Open',1];
  268.                     _veh animateDoor ['DoorL_Back_Open',1];
  269.                     _veh animateDoor ['DoorR_Back_Open ',1];
  270.                 } else {
  271.                     [_veh,0] remoteExecCall ["life_fnc_lockVehicle",_veh];
  272.  
  273.                     _veh animateDoor ["door_back_R",1];
  274.                     _veh animateDoor ["door_back_L",1];
  275.                     _veh animateDoor ['door_R',1];
  276.                     _veh animateDoor ['door_L',1];
  277.                     _veh animateDoor ['Door_L_source',1];
  278.                     _veh animateDoor ['Door_rear',1];
  279.                     _veh animateDoor ['Door_rear_source',1];
  280.                     _veh animateDoor ['Door_1_source',1];
  281.                     _veh animateDoor ['Door_2_source',1];
  282.                     _veh animateDoor ['Door_3_source',1];
  283.                     _veh animateDoor ['Door_LM',1];
  284.                     _veh animateDoor ['Door_RM',1];
  285.                     _veh animateDoor ['Door_LF',1];
  286.                     _veh animateDoor ['Door_RF',1];
  287.                     _veh animateDoor ['Door_LB',1];
  288.                     _veh animateDoor ['Door_RB',1];
  289.                     _veh animateDoor ['DoorL_Front_Open',1];
  290.                     _veh animateDoor ['DoorR_Front_Open',1];
  291.                     _veh animateDoor ['DoorL_Back_Open',1];
  292.                     _veh animateDoor ['DoorR_Back_Open ',1];
  293.                 };
  294.                 systemChat localize "STR_MISC_VehUnlock";
  295.                 [_veh,"unlockCarSound",50,1] remoteExec ["life_fnc_say3D",RANY];
  296.                 } else {
  297.                 if (local _veh) then {
  298.                     _veh lock 2;
  299.  
  300.                     _veh animateDoor ["door_back_R",0];
  301.                     _veh animateDoor ["door_back_L",0];
  302.                     _veh animateDoor ['door_R',0];
  303.                     _veh animateDoor ['door_L',0];
  304.                     _veh animateDoor ['Door_L_source',0];
  305.                     _veh animateDoor ['Door_rear',0];
  306.                     _veh animateDoor ['Door_rear_source',0];
  307.                     _veh animateDoor ['Door_1_source',0];
  308.                     _veh animateDoor ['Door_2_source',0];
  309.                     _veh animateDoor ['Door_3_source',0];
  310.                     _veh animateDoor ['Door_LM',0];
  311.                     _veh animateDoor ['Door_RM',0];
  312.                     _veh animateDoor ['Door_LF',0];
  313.                     _veh animateDoor ['Door_RF',0];
  314.                     _veh animateDoor ['Door_LB',0];
  315.                     _veh animateDoor ['Door_RB',0];
  316.                     _veh animateDoor ['DoorL_Front_Open',0];
  317.                     _veh animateDoor ['DoorR_Front_Open',0];
  318.                     _veh animateDoor ['DoorL_Back_Open',0];
  319.                     _veh animateDoor ['DoorR_Back_Open ',0];
  320.                 } else {
  321.                     [_veh,2] remoteExecCall ["life_fnc_lockVehicle",_veh];
  322.  
  323.                     _veh animateDoor ["door_back_R",0];
  324.                     _veh animateDoor ["door_back_L",0];
  325.                     _veh animateDoor ['door_R',0];
  326.                     _veh animateDoor ['door_L',0];
  327.                     _veh animateDoor ['Door_L_source',0];
  328.                     _veh animateDoor ['Door_rear',0];
  329.                     _veh animateDoor ['Door_rear_source',0];
  330.                     _veh animateDoor ['Door_1_source',0];
  331.                     _veh animateDoor ['Door_2_source',0];
  332.                     _veh animateDoor ['Door_3_source',0];
  333.                     _veh animateDoor ['Door_LM',0];
  334.                     _veh animateDoor ['Door_RM',0];
  335.                     _veh animateDoor ['Door_LF',0];
  336.                     _veh animateDoor ['Door_RF',0];
  337.                     _veh animateDoor ['Door_LB',0];
  338.                     _veh animateDoor ['Door_RB',0];
  339.                     _veh animateDoor ['DoorL_Front_Open',0];
  340.                     _veh animateDoor ['DoorR_Front_Open',0];
  341.                     _veh animateDoor ['DoorL_Back_Open',0];
  342.                     _veh animateDoor ['DoorR_Back_Open ',0];
  343.                 };
  344.                 systemChat localize "STR_MISC_VehLock";
  345.                 [_veh,"lockCarSound",50,1] remoteExec ["life_fnc_say3D",RANY];
  346.                 };
  347.             };
  348.         };
  349.     };
  350.  
  351.     //Gateopener Schranken öffnen
  352.     case 10: {
  353.         [] call life_fnc_GateOpener;
  354.     };
  355.  
  356.     //Ohrstöpsel
  357.     case 11: {
  358.         [] call life_fnc_earplug;
  359.     };
  360.  
  361.     //Farming
  362.     case 12: {
  363.         if (playerSide isEqualto CIVILIAN) then {
  364.             if (typeOf vehicle player == "C_Tractor_01_F") then {
  365.                 _playerIsInside = player inArea "grain_field";
  366.                 if (!((driver vehicle player) == player)) exitwith { ["Du musst der Fahrer sein",true,"fast"] call life_fnc_notification_system; };
  367.                 if (!_playerIsInside) exitwith { ["Du musst auf dem Getreide Feld sein!",true,"fast"] call life_fnc_notification_system; };
  368.                
  369.                 if (life_grain) then {
  370.                     [] spawn life_fnc_grain;
  371.                     life_grain = false;
  372.                 } else {
  373.                     [] spawn life_fnc_grain;
  374.                     life_grain = true;
  375.                 };
  376.                 [] spawn {
  377.                     sleep 2.5;
  378.                 };
  379.             };        
  380.         };
  381.     };
  382.  
  383.     //Signalhorn / Sirene
  384.     case 13: {
  385.         if (playerSide in ([west,independent])) then {
  386.             if (vehicle player != player && {!life_siren_active} && {((driver vehicle player) == player)}) then {
  387.                 [] spawn {
  388.                     life_siren_active = true;
  389.                     sleep 4.7;
  390.                     life_siren_active = false;
  391.                 };
  392.  
  393.                 private _veh = vehicle player;
  394.                 if (isNil {_veh getVariable "siren"}) then {_veh setVariable ["siren",false,true];};
  395.                 if ((_veh getVariable "siren")) then {
  396.                     titleText [localize "STR_MISC_SirensOFF","PLAIN"];
  397.                     _veh setVariable ["siren",false,true];
  398.                     if !(isNil {(_veh getVariable "sirenJIP")}) then {
  399.                         private _jip = _veh getVariable "sirenJIP";
  400.                         _veh setVariable ["sirenJIP",nil,true];
  401.                         remoteExec ["",_jip]; //remove from JIP queue
  402.                     };
  403.                 } else {
  404.                     titleText [localize "STR_MISC_SirensON","PLAIN"];
  405.                     _veh setVariable ["siren",true,true];
  406.                     private "_jip";
  407.                     if (playerSide isEqualTo west) then {
  408.                         _jip = [_veh] remoteExec ["life_fnc_copSiren",RCLIENT,true];
  409.                     } else {
  410.                         _jip = [_veh] remoteExec ["life_fnc_medicSiren",RCLIENT,true];
  411.                     };
  412.                     _veh setVariable ["sirenJIP",_jip,true];
  413.                 };
  414.             };
  415.         };
  416.     };
  417.  
  418.     //Niederschlagen
  419.     case 14: {
  420.         if (!isNull cursorObject && cursorObject isKindOf "CAManBase" && isPlayer cursorObject && alive cursorObject && cursorObject distance player < 4 && speed cursorObject < 1) then {
  421.             if ((animationState cursorObject) != "Incapacitated" && (currentWeapon player == primaryWeapon player || currentWeapon player == handgunWeapon player) && currentWeapon player != "" && !life_knockout && !(player getVariable ["restrained",false]) && !life_istazed && !life_isknocked) then {
  422.                 [cursorObject] spawn life_fnc_knockoutAction;
  423.             };
  424.         };
  425.     };
  426.  
  427.     //Waffe Holstern
  428.     case 15: {
  429.         if (!(currentWeapon player isEqualTo "")) exitWith {
  430.             life_curWep_h = currentWeapon player;
  431.             player action ["SwitchWeapon", player, player, 100];
  432.             player switchCamera cameraView;
  433.         };
  434.  
  435.         if (!isNil "life_curWep_h" && {!(life_curWep_h isEqualTo "")}) then {
  436.             if (life_curWep_h in [primaryWeapon player,secondaryWeapon player,handgunWeapon player]) then {
  437.                 player selectWeapon life_curWep_h;
  438.             };
  439.         };
  440.     };
  441.  
  442.  
  443.     //Blaulicht
  444.     case 16: {
  445.         if (!(isNull objectParent player) && (typeOf vehicle player) in ["C_Quadbike_01_F","C_Hatchback_01_F","C_Hatchback_01_sport_F","C_SUV_01_F","C_Offroad_01_F","C_Offroad_02_unarmed_F","I_E_Offroad_01_comms_F","I_E_Offroad_01_covered_F","B_GEN_Van_02_transport_F","B_GEN_Van_02_vehicle_F","C_Van_02_medevac_F","C_IDAP_Van_02_medevac_F","C_Van_02_vehicle_F","C_Van_02_transport_F","B_MRAP_01_F","O_T_LSV_02_unarmed_black_F","B_LSV_01_unarmed_black_F","O_T_LSV_02_unarmed_F","B_Truck_01_flatbed_F","I_Truck_02_fuel_F","C_Van_01_fuel_F","O_Truck_03_repair_F","I_LT_01_scout_F","O_APC_Wheeled_02_rcws_v2_F","B_APC_Wheeled_01_cannon_F"]) then {
  446.             _debuga = vehicle player getVariable "lights";
  447.             if (!isNil {vehicle player getVariable "lights"}) then {
  448.                 if (playerSide isEqualTo west) then {
  449.                 [vehicle player] call life_fnc_sirenLights;
  450.                 } else {
  451.                 [vehicle player] call life_fnc_medicSirenLights;
  452.                 };
  453.                 _handled = true;
  454.             };
  455.         };    
  456.     };
  457.  
  458.     //Geschwindigkeitsmessung
  459.     case 17: {
  460.         [] call life_fnc_radar;  
  461.     };
  462.    
  463.     //Absperrungen
  464.     case 18: {
  465.         if ((isNull(findDisplay 20000)) && (playerSide in ([west,independent]))) then {
  466.             0 spawn life_fnc_placeablesMenu;
  467.             _handled = true;
  468.         };
  469.         _handled = true;    
  470.     };
  471.  
  472.     //Ergeben
  473.     case 19: {
  474.         if (player getVariable ["playerSurrender",false]) then {
  475.             player setVariable ["playerSurrender",false,true];
  476.         } else {
  477.             [] spawn life_fnc_surrender;
  478.         };
  479.         _handled = true;
  480.     };
  481.  
  482.     //Absperrung platzieren
  483.     case 20: {
  484.         if (life_barrier_active) then {
  485.             0 spawn life_fnc_placeablesPlaceComplete;
  486.         };
  487.     };
  488.  
  489.     //Springen
  490.     case 21: {
  491.         if (isNil "jumpActionTime") then {jumpActionTime = 0;};
  492.         if (!(animationState player isEqualTo "AovrPercMrunSrasWrflDf") && {isTouchingGround player} && {stance player isEqualTo "STAND"} && {speed player > 2} && {!life_is_arrested} && {((velocity player) select 2) < 2.5} && {time - jumpActionTime > 2}) then {
  493.             if (life_barrier_active) then { [true] call life_fnc_placeableCancel; };
  494.             jumpActionTime = time; //Update the time.
  495.             [player] remoteExec ["life_fnc_jumpFnc",RANY]; //Global execution
  496.             _handled = true;
  497.         };
  498.     };
  499.  
  500.     //Ausweis
  501.     case 22: {
  502.         if(!(life_idcard_data isEqualto [])) then {
  503.             if(!isnull cursorTarget) then {
  504.                 if(alive cursorTarget) then {
  505.                     if(cursorTarget isKindOf "Man") then {
  506.                         [life_idcard_data,getplayeruid player] remoteExecCall ["life_fnc_show_idcard",cursorTarget];
  507.                         [ format[localize "STR_capps_cur_error_success",name cursorTarget],true,"fast"] call life_fnc_notification_system;
  508.                     } else {
  509.                         [life_idcard_data,getplayeruid player] spawn life_fnc_show_idcard;
  510.                         [ localize "STR_capps_cur_error_no_target",true,"fast"] call life_fnc_notification_system;
  511.                     };
  512.                 } else {
  513.                     [life_idcard_data,getplayeruid player] spawn life_fnc_show_idcard;
  514.                     [ localize "STR_capps_cur_error_not_alive",true,"fast"] call life_fnc_notification_system;
  515.                 };
  516.             } else {
  517.                 [life_idcard_data,getplayeruid player] spawn life_fnc_show_idcard;
  518.                 [ localize "STR_capps_cur_error_no_target",true,"fast"] call life_fnc_notification_system;
  519.             };
  520.         } else {
  521.             [ localize "STR_capps_cur_error_no_idcard",true,"fast"] call life_fnc_notification_system;
  522.         };
  523.     };
  524.  
  525.     //Dienstausweis
  526.     case 23: {
  527.         if(!(playerSide isEqualto CIVILIAN)) then {
  528.             if(!(life_idcard_data isEqualto [])) then {
  529.                 if(!isnull cursorTarget) then {
  530.                     if(alive cursorTarget) then {
  531.                         if(cursorTarget isKindOf "Man") then {
  532.                             [life_idcard_data,getplayeruid player,playerSide,(call life_coplevel) + (call life_mediclevel)] remoteExecCall ["life_fnc_show_idcard",cursorTarget];
  533.                             [ format[localize "STR_capps_cur_error_success_card",name cursorTarget],true,"fast"] call life_fnc_notification_system;
  534.                         } else {
  535.                             [life_idcard_data,getplayeruid player,playerSide,(call life_coplevel) + (call life_mediclevel)] spawn life_fnc_show_idcard;
  536.                             [ localize "STR_capps_cur_error_no_target",true,"fast"] call life_fnc_notification_system;
  537.                         };
  538.                     } else {
  539.                         [life_idcard_data,getplayeruid player,playerSide,(call life_coplevel) + (call life_mediclevel)] spawn life_fnc_show_idcard;
  540.                         [ localize "STR_capps_cur_error_not_alive",true,"fast"] call life_fnc_notification_system;
  541.                     };
  542.                 } else {
  543.                     [life_idcard_data,getplayeruid player,playerSide,(call life_coplevel) + (call life_mediclevel)] spawn life_fnc_show_idcard;
  544.                     [ localize "STR_capps_cur_error_no_target",true,"fast"] call life_fnc_notification_system;
  545.                 };
  546.             } else {
  547.                 [ localize "STR_capps_cur_error_no_idcard",true,"fast"] call life_fnc_notification_system;
  548.             };
  549.         };
  550.     };
  551.  
  552.     //Absperrung entfernen
  553.     case 24: {
  554.         if ((typeOf cursorTarget) in life_definePlaceables) then {
  555.             deleteVehicle cursorTarget;
  556.             [ "Die Absperrung wurde entfernt",false,"fast"] call life_fnc_notification_system;
  557.         };
  558.     };
  559. };
  560.  
  561. _handled;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement