Files
DayZ-Epoch/dayz_code/compile/player_onPause.sqf
vbawol c4fa47f4d9 0.85
2013-02-01 01:47:36 -06:00

44 lines
1.3 KiB
Plaintext

private["_display","_btnRespawn","_btnAbort","_timeOut","_timeMax","_isDead"];
disableSerialization;
waitUntil {
_display = findDisplay 49;
!isNull _display;
};
_btnRespawn = _display displayCtrl 1010;
_btnAbort = _display displayCtrl 104;
_btnRespawn ctrlEnable false;
_btnAbort ctrlEnable false;
_timeOut = 0;
_timeMax = 30;
_isDead = !alive player;
if(r_fracture_legs) exitWith {_btnRespawn ctrlEnable true;};
if(_isDead) exitwith {_btnAbort ctrlEnable true;};
sleep 1;
while {!isNull _display} do {
switch true do {
case ({isPlayer _x} count (player nearEntities ["AllVehicles", 6]) > 1) : {
_btnAbort ctrlEnable false;
cutText ["Cannot Abort near another player!", "PLAIN DOWN"];
};
/*
case (_timeOut < _timeMax && count (player nearEntities ["zZombie_Base", 50]) > 0) : {
_btnAbort ctrlEnable false;
cutText [format ["Can Abort in %1", (_timeMax - _timeOut)], "PLAIN DOWN"];
_timeOut = _timeOut + 1;
};
*/
case (player getVariable["combattimeout", 0] >= time) : {
_btnAbort ctrlEnable false;
cutText ["Cannot Abort while in combat!", "PLAIN DOWN"];
};
default {
_btnAbort ctrlEnable true;
cutText ["", "PLAIN DOWN"];
};
};
sleep 3;
};
cutText ["", "PLAIN DOWN"];