Jump to content
Dantspa

How can i config onpause menu "save game " button

Recommended Posts

 

I have rental dedi arma 3 server and i have INIDBI2 for save system on it. Right now there is a save game button in the game screen, but i want to get it on the pause menu save game button, the button is grey now. Button i have right now is scripted like this: 

"initplayerlocal.sqf"

 

Player addAction ["<t color=`#38BAFF`>Save Game</t>", {[] call UN_savedata;}];

 

How can i script it in the onpause menu "save game" button?

 

I find this link, but i don`t get it work

 

 

Share this post


Link to post
Share on other sites

Its not possible to use armas own save game, its not working. Database working fine in this server , but the save button i have right now It's a little bit annoying. Every time you leave inventory save game text comes to the middle of the screen and you need to spin the mouse wheel and press the right mouse button to get it off. That's why I'd like it to the pause menu save button.

Share this post


Link to post
Share on other sites

Using the save button does not work if it is greyed out. It is best to script the continue button in multiplayer.

 

This example will change the Continue button and make it blue, as well as run your function when it is clicked.

 

h = [] spawn {
	while {true} do {
		waitUntil {! isNull (findDisplay 49)};
		_btn = ((findDisplay 49) displayCtrl 2) ctrlSetText "Save progress.";
		_btnclr = ((findDisplay 49) displayCtrl 2) ctrlSetBackgroundColor [0, 0, 0.9, 1];
		_CEH = ((findDisplay 49) displayCtrl 2) ctrlAddEventHandler ["MouseButtonDown",{(findDisplay 49) closeDisplay 0; [] call UN_savedata;}];
		waitUntil {isNull (findDisplay 49)};
	};
};

This should do what you want. I used this for my own mission to load a dialog of options when it is clicked. Put this in the initPlayerLocal.sqf and give it a shot.

  • Like 2

Share this post


Link to post
Share on other sites

Thanks Jakeplissken, You're the best!! Now it's just what I wanted and it works great. I've been fighting this for almost two weeks. I'm soooo happy it works now😁

Share this post


Link to post
Share on other sites

This is a modern updated version.

 

[missionNamespace,"OnGameInterrupt", {
    _this spawn {
        params ["_display"];
		_display displayCtrl 2 ctrlShow false;
		_display displayCtrl 103 ctrlShow false;
		_display displayCtrl 115099 ctrlShow false;
		_display displayCtrl 523 ctrlShow false;
		_display displayCtrl 104 ctrlSetText "Quit current mission...";
		_display displayCtrl 2 ctrlSetBackgroundColor [0.7, 0.3, 0.9, 1];
		_display displayCtrl 1005 ctrlSetText format ["CO80 Afghan ops. %1 : Arma 3 v%2.%3!", "1.80", (productVersion select 2), (productVersion select 3)];
        _display displayCtrl 120 ctrlSetText "Enemy insurgents have invaded Afghanistan. Destroy their assets and remove all enemies. This must be carried out in a humanitarian way, minimising damage to civilian assets.";
		_display displayCtrl 6455 ctrlShow true;
		_display displayCtrl 6455 ctrlSetText format ["%1", profileName];
    };
}] call BIS_fnc_addScriptedEventHandler;

This works properly on a dedicated server.

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

×