Arma 3
Mavic 3
Daniel H. Jan 19, 2024 @ 2:23pm
Improvement for the registration of grenade drop keybind
Hey, thanks for the mod. I have an improvement for the registration of the grenade drop keybind with CBA, in the XEH_preInit.sqf. Can you change the function to the code below?

The current solution blocks the keybind from being used for default arma, even if you are not in the mavic. This script solves that problem, and makes sure it is only triggered when a grenade can be dropped. It should also be possible to use "L" as key now, to make it more intuitive for new users.

[
"Mavic Drop",
"MavicDropKey",
["Mavic Drop Key", "Keybind for dropping grenade"],
{
// Check if the player can drop a grenade using the custom function
if (player call mavic_fnc_checkGrenadeDrop) then {
true
} else {
// Return false if the conditions for grenade drop are not met
false
}
}, // On key down
"", // On key up (empty)
[35, [false, true, false]] // Can be changed to [38, [false, false, false]] (L) now if needed
] call cba_fnc_addKeybind;

Further improvement would be to seperate the check function from the actual drop function, and put that logic in the place of "true", but this also works fine. Thanks!
Last edited by Daniel H.; Jan 19, 2024 @ 2:32pm