Jump to content

[Ignatz] Earplug Script


He-Man

Recommended Posts

2 hours ago, Tarabas said:

Thank you for your sharing this He-Man...

would it be possible to get the entries for Epoch AH Keydown to allow all players let the hotkey work like you did in your statusbar script ?

Sure.

Comment out in Ignatz_Client_StartScript.sqf:

Spoiler

[] call Ignatz_Client_EH_KeyDown;

//  [] call Ignatz_Client_EH_KeyDown;

 

And add in EPOCH_KeyDown.sqf:

Spoiler

.....
if (_dikCode in (actionKeys "NightVision")) then {
    if (EPOCH_playerEnergy == 0) then {
        ["Night Vision Goggles: Need Energy", 5] call Epoch_message;
        _handled = true;
    };
};

if (!isnil 'Ignatz_KB_Earplug') then {
    if (_dikCode == Ignatz_KB_Earplug) then {
        [] call Ignatz_Client_Earplugger
    };
};

_handled

 

Link to comment
Share on other sites

I also added hints     hint 'Earplugs have been auto-inserted...'; to Ignatz_Client_EH_GetInMan and         hint 'Earplugs have been auto-removed...'; to Ignatz_Client_EH_GetOutMan and both work fine..

where should i put systemchat msg to get info that i put in earpluggs manually ?

Is there also a possibility to (re)disable earplugs when you're in a vehicle ?

Link to comment
Share on other sites

I would put the systemchat in the KeyDown EH directly before the "[] call Ignatz_Client_Earplugger":

Spoiler

...
if (Ignatz_Earplugsin) then {
    systemchat 'Earplugs have been removed";
}
else {
    systemchat 'Earplugs have been inserted";
};
[] call Ignatz_Client_Earplugger;
...

What do you mean with (re)disable? No pissiblility to put them in / out inside Vehicles?

Link to comment
Share on other sites

1 hour ago, He-Man said:

What do you mean with (re)disable? No pissiblility to put them in / out inside Vehicles?

yes, that's what I mean.. sorry my complicated language...would be a nice additional feature in my opinion.

 

I tried with that you gave me here, but it didn't work. I also changed the " like yours and tried without  case Ignatz_KB_Earplug: { };

Earplugs still work but get no message..

 

 
	(findDisplay 46) displayAddEventHandler ['KeyDown',
    {
        _return = false;
        switch (_this select 1) do {
        case Ignatz_KB_Earplug: {
if (Ignatz_Earplugsin) then {
    systemchat 'Earplugs have been removed';
}
else {
    systemchat 'Earplugs have been inserted';
};
                [] call Ignatz_Client_Earplugger;
	};
};
        _return
    }
];
	 
	
Link to comment
Share on other sites

Quote

and I see players get a Ban: EH: Killed in Hackerlog after using its hotkey

(also without changes for systemchat or hint :-/)

Edit: If a player dies it spams systemchat 15 times "playerx commited suicide" or "playerx was killed by player y"

Tarabas, I made an experimental branch. Can you test it please?

https://github.com/Ignatz-HeMan/Ignatz_Client_Earplugs/tree/Experimental

Link to comment
Share on other sites

_Ignatz_UsingEpochAH		= true;	// Set to true if using Epoch Antihack - NOTE: if true, you have to add Keydown EH manually to the Epoch Files (see readme)
Ignatz_KB_Earplug			= 0x3E;		// F4
Ignatz_AutoEarplugs			= true;		// Auto insert / remove Earplugs by entering leaving Vehicles
Ignatz_EnableEarpluginVeh	= true;		// Set it to false to disable manual Earplugs in Vehicles
Ignatz_AutoEarplugsHints	= true;	// Enable / Disable hint message on Auto-Earplugs
Ignatz_EarplugsSystemchat	= true;		// Enable / Disable systemchat messages for Earplugs

yes like this

Link to comment
Share on other sites

That's exactly what was missing... sorry for I post before reading readme... Thank you again for your fast work and support.

Maybe if you wanna share option for hints in Readme too it also works again with:

Quote

if (!isnil 'Ignatz_KB_Earplug') then {
    if (_dikCode == Ignatz_KB_Earplug) then {
        if (Ignatz_EnableEarpluginVeh || player == vehicle player) then {
            if (Ignatz_EarplugsSystemchat) then {
                if (Ignatz_Earplugsin) then {
                    systemchat 'Earplugs have been removed...';
                    hint 'Earplugs have been removed...';
                }
                else {
                    systemchat 'Earplugs have been inserted...';
                    hint 'Earplugs have been inserted...';
                };
            };
            [] call Ignatz_Client_Earplugger;
        };
    };
};

tested->worked

Link to comment
Share on other sites

Did I add the code for the keydown.sqf correctly, it doesnt seem to be working for me.

 

// end player only code

if (_dikCode in (actionKeys "Salute")) then {
    if (_ctrl) then {
        player playactionNow "GestureFinger";
        _handled = true;
    };
};
if (_dikCode in (actionKeys "TacticalView")) then {
    _handled = true;
};
if (_dikCode in (actionKeys "NightVision")) then {
    if (EPOCH_playerEnergy == 0) then {
        ["Night Vision Goggles: Need Energy", 5] call Epoch_message;
        _handled = true;
    };
};
if (!isnil 'Ignatz_KB_Earplug') then {
    if (_dikCode == Ignatz_KB_Earplug) then {
        if (Ignatz_EnableEarpluginVeh || player == vehicle player) then {
            if (Ignatz_EarplugsSystemchat) then {
                if (Ignatz_Earplugsin) then {
                    systemchat 'Earplugs have been removed...';
                }
                else {
                    systemchat 'Earplugs have been inserted...';
                };
            };
            [] call Ignatz_Client_Earplugger;
        };
    };
};

_handled

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...