Jump to content
svarun

Limit the number of revives

Recommended Posts

How can I limit the number of revives that a player can have?

 

I am using the regular Arma's End Game revive sytem.

Share this post


Link to post
Share on other sites

I don't think that's possible yet, but feel free to suggest it here, so the devs become aware of it.

Share this post


Link to post
Share on other sites

You can only somewhat limit it by enabling this setting:

ReviveRequiredItemsFakConsumed = 1;

That way you can only revive as long as you have FAKs available. You'll just have to limit the availability of those (remove them from vehicles and enemies).

Share this post


Link to post
Share on other sites

Tickets are only for the respawn template afaik, not for the revive system.

Share this post


Link to post
Share on other sites

Some thing like...

//initPlayerLocal.sqf
#include "\a3\functions_f_mp_mark\Revive\defines.hpp"

#define ALLOWED_REVIVIES 2

player addEventHandler [ "HandleDamage", {
    params[ "_unit", "_selectionName" ];
    
    if ( _selectionName == "" ) then {
diag_log str _this;
        _state = GET_STATE( player );
        _h = _state spawn {
            params[ "_currentState" ];
            
            //Wait frame for BI EHs to establish state
            waitUntil{ true };
diag_log format[ "Prev = %1", GET_STATE_STR( _currentState ) ];
diag_log format[ "New = %1", GET_STATE_STR( GET_STATE( player ) ) ];
            //Are we are unconscious and were not already unconscious
            if ( IS_DISABLED( player ) && !( _currentState isEqualTo STATE_INCAPACITATED ) ) then {
                _revivesLeft = player getVariable[ "allowedRevives", ALLOWED_REVIVIES ];

                if ( _revivesLeft > 0 ) then {
                    //Wait until we are not unconscious
                    waitUntil{ !IS_DISABLED( player ) };                
                    //If we were revived
                    if ( GET_STATE( player ) isEqualTo STATE_REVIVED ) then {
                        //Decrease our allowed revivies
                        player setVariable [ "allowedRevives", _revivesLeft - 1 ];
                    };
                }else{
                    //Kill the player
                    player setDamage 1;
                };
            };
diag_log format[ "Done - remaining = %1", player getVariable[ "allowedRevives", ALLOWED_REVIVIES ] ];            
        };
    };
}];
May need to fineness and you will need to handle respawns for how ever you have it set up.
  • Like 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

×