Jump to content
bumyplum

[Help] Disable escape options when killed

Recommended Posts

Is there a way to disable a players abort button whilst the player is dead then activate it again once they're alive?

Share this post


Link to post
Share on other sites
//in your
//description.ext

onPauseScript = "script.sqf";


//In
//script.sqf

disableSerialization;

if (!alive player) then  {((findDisplay 49) displayctrl 104) ctrlShow false;};

Might work (untested)

  • Like 2

Share this post


Link to post
Share on other sites

Another method is keyDown EH. @Mr H.'s method makes sense and is easier.

Share this post


Link to post
Share on other sites
15 hours ago, HazJ said:

Another method is keyDown EH. @Mr H.'s method makes sense and is easier.

I'm wanting it to be executed through a button ingame

Share this post


Link to post
Share on other sites

What do you mean?

Share this post


Link to post
Share on other sites

You mean as an option you can toggle on and off? It's doable but takes more work.

Share this post


Link to post
Share on other sites

you can try that it should add a button to toggle it on and off at the bottom of your pause screen if you are a logged in admin.
EDIT: Tested at home,works fine, you'll have to resize reposition the button though.
 

//in your
//description.ext

onPauseScript = "script.sqf";


//In
//script.sqf



if (serverCommandAvailable "#kick") then {
with uiNamespace do  
					{ 
						_ctrl = findDisplay 49 ctrlCreate ["RscButton", -1]; 
						_ctrl ctrlSetPosition [0.917656 * safezoneW + safezoneX,0.94 * safezoneH + safezoneY,0.0773437 * safezoneW,0.044 * safezoneH]; 
						_ctrl ctrlSetText "Disable abort for dead players"; 
						_ctrl ctrlCommit 0; 
						_ctrl ctrlAddEventHandler ["ButtonDown",  
						 { 
                        _status = missionNamespace getVariable ["TAG_abortIsAllowed",true];
                        if (_status) then {missionNamespace setVariable ["TAG_abortIsAllowed",false,true];systemChat "abort disabled"} else {missionNamespace setVariable ["TAG_abortIsAllowed",true,true]; systemchat "abort enabled"};
						 
						  
						 }]; 
					};
};

_status = missionNamespace getVariable ["TAG_abortIsAllowed",true];
if (_status) exitWith {};
disableSerialization;

if (!alive player) then  {((findDisplay 49) displayctrl 104) ctrlShow false;};

 

  • Thanks 2

Share this post


Link to post
Share on other sites

If for some reason, someone will need to disable (by default) abort button while the player is ace unconscious, you need to replace the last line:

if (!alive player) then {((findDisplay 49) displayctrl 104) ctrlShow false;};

with this:

if (player getVariable "ACE_isUnconscious" isEqualTo true) then  {((findDisplay 49) displayctrl 104) ctrlShow false;};

 

I needed to do it for punishing players who are abusing the lack of saving ace unconscious players by GRAD Persistence 

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

×