Jump to content
Nixx57

Replace Action by key "Use Action X"

Recommended Posts

Hello everyone

There you go, I just made my first mod and I want to change the way I interact with it.


In short, my mod adds an action to players that opens a menu (menu that allows you to put on music and adjust the volume). And I would like to replace the action in the menu with a key press (pe :Use Action 20/User20 ).

And if possible, add more (p.e : User19 = 0 fadeMusic (musicVolume + 0.1)).

 

If I can do without the scripts file, so only the config.cpp would be cool considering the lightness of the code


Unfortunately, I couldn't find any information on the wiki on how to use actions (in cpp) except for this page:

 

inputAction/actions - Bohemia Interactive Community (bistudio.com)

 

 

I thank you in advance ❤


The mod : https://steamcommunity.com/sharedfiles/filedetails/?id=2312443810

 

Currently my config.cpp is as follows:

class CfgPatches
{
	class Menu
	{
		units[] = {};
		weapons[] = {};
		requiredVersion = 0.1;
		requiredAddons[] = {};
	};
};

class CfgVehicles
{
	class All
	{
		class UserActions
		{
			class MusicMenu
			{
				displayName = "<t color='#FF0000'><img image='\a3\data_f_tank\images\upgradedaudio_ca.paa' size='1'/> Radio Box</t>";
				displayNameDefault = "<img image='\a3\data_f_tank\images\upgradedaudio_ca.paa' size='3' />";
				priority = -998;
				radius = 20;
				position = "camera";
				showWindow = 0;
				hideOnUse = 0;
				onlyForPlayer = 1;
				condition = "this == vehicle player";
				statement = "createDialog ""Menu_GUI"" ";
			};
		};
	}
}


#include "commonDefs.hpp"
#include "dialog\MusicGUI.hpp"

 

Share this post


Link to post
Share on other sites

UserActions

Where shortcut is what your looking for and is set to the actionName as referenced in the link you provided.

  • Thanks 1

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

×