Jump to content

Door Escape Blocker | DEB


Soul

Recommended Posts

This is a modified version of a script i was using a long time to block esc on a custom spawn selection screen i'm using on our

vanilla dayz servers.

 

What this does is check for keypresses when the doorlock ui is active, when it detects the user pressing esc it cancles the actions. 

This effectivly blocks the user from closing the dialog with the escape button. Have fun with it.

 

Create a new file called antiBruteForce.sqf

NPG_fnc_cKeyDownGenericDisplay = {
    private["_keypressed","_return"];
    _keypressed = _this select 1;
    _return = false;

    #define KEYSCODE_ESC_KEY    1

    // disable esc while in dialog
    switch (_keypressed) do
    {
        case KEYSCODE_ESC_KEY:
        {
            _return = true;
        };
    };
    _return;
};

[] spawn {
waitUntil {sleep 0.01; (!(isNull (findDisplay 41144)))};
disableSerialization;
_foundComboLockUI = findDisplay 41144;
_foundComboLockUI displayAddEventHandler ["KeyDown","_this call NPG_fnc_cKeyDownGenericDisplay"];
};

Now you can include the file. It has to be run on the client so make shure it is somewhere included

inside a if(!isDedicated) {}; check and make shure that your path to this file is set according to its location in your mission.

#include "antiBruteForce.sqf"

I'll try to update this script tonight as i dont think it needs the spawn and waituntill. But this version does work for shure.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...