Jump to content

fn_keyhandler.sqf doesn't work anymore


Recommended Posts

Hey,

I createt a Repairjob System by myself. When I wanted to test it, there was the Problem, that no one of the hotkeys defined in the fn_keyhandler.sqf is working anymore.

This is the Code i added for the Hotkey in the fn_keyhandler:

//Objekte reparieren (STRG + R)
    case 19: {
        if (_ctrlKey) then {
            if(player getVariable "amc_duty_stat" OR player getVariable "repairjob") then {
              [] spawn ylrpg_fnc_roadrepair;
            } else if (!(player getVariable "amc_duty_stat") AND !(player getVariable "repairjob")) then {
              ["Du musst dir erst an der Straßenmeisterei eine Ausrüstung organisieren", "fast", "warning", "Straßenmeisterei"] call ylrpg_fnc_notification_system;
            _handled = true;
        };
    };


This is my "fn_repairjob.sqf"
 

#include "..\..\..\script_macros.hpp"
/*
  Author: Dennis
  Server: YourLife RPG
  Description: Terrain Repair Job, 5m Umkreis
*/
    _objects = nearestTerrainObjects [player, [], 5, false];

        _objCount = 1;//{_object} count;

      {
          _x setDamage 0;
    		if(_x getVariable ['hidden_adm',false]) then {
    			[11,player,1,_x] remoteExecCall ['ton_fnc_rem_proxy',2];
    		};
      } forEach _objects;

  if(player getVariable "amc_duty_stat") then {
      // Rechne die Vergütung aus (AMC)
        _ammount = _objCount * 50;
        BANK = BANK + _ammount;
        [1] call SOCK_fnc_updatePartial;

      // Informiere den AMCler
      [
        format[
          "Du hast %1 Objekte im Umkreis von 5m erfolgreich reparieren können. Dafür hat dein Chef dir %2$ zusätzlich zu deinem Gehalt überwiesen! Das Geld wurde auf dein Bankkonto überwiesen.",
          [_objCount] call life_fnc_numberText,
          [_ammount] call life_fnc_numberText
        ],
        "fast",
        "info",
        "Spielerinformation"
      ] call ylrpg_fnc_notification_system;
  } else {
    // Rechne die Vergütung aus (Zivilist)
      _ammount = _objCount * 10;
      BANK = BANK + _ammount;
      [1] call SOCK_fnc_updatePartial;

    // Informiere den Spieler
    [
      format[
        "Du hast %1 Objekte im Umkreis von 5m erfolgreich reparieren können. Dafür hat dich der Bürgermeister mit %2$ belohnt! Das Geld wurde auf dein Bankkonto überwiesen.",
        [_objCount] call life_fnc_numberText,
        [_ammount] call life_fnc_numberText
      ],
      "fast",
      "info",
      "Spielerinformation"
    ] call ylrpg_fnc_notification_system;
  };

this ist my fn_getrepairjob.sqf which is called via addaction on the Map (to rent the repair equipment)

 

#include "../../../script_macros.hpp"
/*
  Author: Dennis
  Server: YourLife RPG
  Description: Getting the Repair Job
*/
if(player getVariable "repairjob") then {
  player setVariable ["repairjob", false, true];

  BANK = BANK + 1000;
  [1] call SOCK_fnc_updatePartial;

  ["Du hast deine Ausrüstung der Straßenmeisterei zurück gegeben. Dein Pfand wurde dir zurück gezahlt", "fast", "info", "Straßenmeisterei"] call ylrpg_fnc_notification_system;
} else {
  player setVariable ["repairjob", true, true];

  BANK = BANK - 1000;
  [1] call SOCK_fnc_updatePartial;
  ["Du hast dir von der Straßenmeisterei eine Ausrüstung geliehen. Dir wurden 1.000$ Pfand vom Konto abgezogen. Wenn du die Ausrüstung vor der Sonnenwende zurück bringst, bekomsmt du das Pfand zurück!", "fast", "info", "Straßenmeisterei"] call ylrpg_fnc_notification_system;
}



Can anyone find any malefunction that causes the problem with the keyhandler? It is a proven fact, that this is the only changed/added system or file this 3 are (yes, i entered the classes to the functions.hpp but we defently excludet, that the malefunction is in this file).

In the Attachment you can find my Server and Client Logfiles

I know that there in the logs are an error with the admin duty system.
But the System was developed AFTER the problem with the keyhandler, and the errors are already fixed - no changeing withhin the main error

Arma3_x64_2021-03-08_21-54-55.rpt arma3server_x64_2021-03-08_22-13-46.rpt

Edited by Denniis_CHX45
Link to post
Share on other sites
  • 4 weeks later...

Think I may of found the issue.

Quote

22:04:43 File core\functions\fn_keyHandler.sqf [life_fnc_keyHandler]..., line 210
22:04:43 Error in expression <(_shift) then {
if(life_adminlevel >= 1){
[] call ylrpg_fnc_adminDutySystem;
};
>
22:04:43   Error position: <{
[] call ylrpg_fnc_adminDutySystem;
};

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.