mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Tested while autorunning: - getting knocked out - breaking legs - running into water - getting into and out of vehicles - climbing a ladder - dying - antiTP enabled - running up steep hills - as player zombie Everything works as expected. This does allow you to run up and down pretty steep hills, but if you try to scale something too steep you will break your legs as expected.
62 lines
2.5 KiB
Plaintext
62 lines
2.5 KiB
Plaintext
private ["_totalTimeout","_timeout","_bloodLow","_display","_ctrl1","_ctrl1Pos","_disableHdlr"];
|
|
disableSerialization;
|
|
if ((!r_player_handler1) && (r_handlerCount == 0)) then {
|
|
if (r_player_cardiac) then {r_player_timeout = r_player_timeout max 300;};
|
|
_totalTimeout = r_player_timeout;
|
|
if (_totalTimeout == 0) then { _totalTimeout = 1; };
|
|
4 cutRsc ["playerStatusWaiting", "PLAIN",0];
|
|
_display = uiNamespace getVariable 'DAYZ_GUI_waiting';
|
|
_ctrl1 = _display displayCtrl 1400;
|
|
_ctrl1Pos = ctrlPosition _ctrl1;
|
|
_timeout = 0;
|
|
r_handlerCount = r_handlerCount + 1;
|
|
r_player_handler1 = true;
|
|
if (vehicle player == player) then {
|
|
player playAction "CanNotMove";
|
|
};
|
|
"dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [2]; "dynamicBlur" ppEffectCommit 0;
|
|
"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.1], [1, 1, 1, 0.0]];"colorCorrections" ppEffectCommit 0;
|
|
0 fadeSound 0.05;
|
|
disableUserInput true;
|
|
_disableHdlr = [] spawn { uiSleep 2; disableUserInput true; r_player_unconsciousInputDisabled = true; };
|
|
autoRunActive = 0;
|
|
while {r_player_unconscious} do {
|
|
_ctrl1 ctrlSetPosition [(_ctrl1Pos select 0),(_ctrl1Pos select 1),(_ctrl1Pos select 2),((0.136829 * safezoneH) * (1 -(r_player_timeout / _totalTimeout)))];
|
|
_ctrl1 ctrlCommit 1;
|
|
playSound "heartbeat_1";
|
|
uiSleep 1;
|
|
_bloodLow = ((r_player_blood/r_player_bloodTotal) < 0.5);
|
|
|
|
if(_timeout == 0) then {
|
|
if (!r_player_dead && !_bloodLow && r_player_injured) then {
|
|
_timeout = 10;
|
|
};
|
|
} else {
|
|
_timeout = _timeout - 1;
|
|
};
|
|
|
|
if (r_player_timeout > 0) then {
|
|
r_player_timeout = r_player_timeout - 1;
|
|
} else {
|
|
if (!r_player_dead) then {
|
|
_nul = [] spawn fnc_usec_recoverUncons;
|
|
};
|
|
};
|
|
if (!(player getVariable ["NORRN_unconscious", true])) then {
|
|
_nul = [] spawn fnc_usec_recoverUncons;
|
|
};
|
|
if(animationState player == "AmovPpneMstpSnonWnonDnon_healed") then {
|
|
_nul = [] spawn fnc_usec_recoverUncons;
|
|
};
|
|
};
|
|
4 cutRsc ["default", "PLAIN",1];
|
|
terminate _disableHdlr;
|
|
waituntil {scriptDone _disableHdlr};
|
|
disableUserInput false; r_player_unconsciousInputDisabled = false;
|
|
if (!r_player_injured && ((r_player_blood/r_player_bloodTotal) >= 0.5)) then {
|
|
10 fadeSound 1;
|
|
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
|
|
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;
|
|
};
|
|
r_handlerCount = r_handlerCount - 1;
|
|
}; |