Jump to content
Sign in to follow this  
Phyma

Trying to disable some keyboard input while script is running

Recommended Posts

Hello!

Im working on a repack magazine mod.

As the topic states im trying to prevent the user from moving, vault, check gear etc. while the script is running in my mod.

So how do i do this?

I want the character to be able to press escape and look around and press the key stated in "User6".

While the script runs there will be a action running:

_unit playAction "Gear"

I have tryed using somesort of displayremovealleventhandler and that didnt work (probably think it does something it dosent)

I call the script from init file:

(findDisplay 46) displayAddEventHandler ["KeyDown", {[_this,["User6",false,false,false], {player call SOD141_fnc_repack;}, {},"SOD141_var_repackRunning"] call SOD141_fnc_keypressed;}];

then inside my script i have a similar to check if you abort the script:

(findDisplay 46) displayAddEventHandler ["KeyDown", {[_this,["User6",false,true,false], {},{}, "SOD141_var_repackAbort"] call SOD141_fnc_keypressed;}];

So please help me and thank you :)

Share this post


Link to post
Share on other sites

Im not that well understood in dialogs and ctrls.

But If i create my script inside a dialog will all the keypresses be inside that dialog and nothing for arma?

For example if im inside my dialog and presses "R" (vanilla reload) will the player start to reload? or just do nothing?

Thanks :)

Share this post


Link to post
Share on other sites

You could create an empty dialog and add an "onUnload" handler which terminates the packing process.

Share this post


Link to post
Share on other sites
What if you use this?

disableUserInput

Wouldn't use that since this disables all inputs, even the "ESC"-Button. If you get it wrong the only way for the player to get the game working again is by killing the ARMA process and restarting ARMA.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×