psychognatz
New Member
Hi folks,
I need some help to put a delay on the abort button when a player dies, because if he dies and aborts really quick the corpse vanishes...
and there is also the problem if a player dies and quickly aborts and comes back into the game to fast, he spawns with broken leg and bleeding and unconscious and that happen really often when server is running 2h+ without restart ! you can see that by looking at the kill messages, if server is running 2h+ with 40/40 playerlimit and someone kills a player it takes ~30 seconds until the killmessage shows up, what means that it takes like 30 seconds to execute the server_playerdied.sqf and if people come back into game quicker than that delay they spawn with broken legs and stuff....
that is my onPauseScript:
I tried so many things now but I couldnt manage to put a delay on abort button after death -.- please help me !!!
I need some help to put a delay on the abort button when a player dies, because if he dies and aborts really quick the corpse vanishes...
and there is also the problem if a player dies and quickly aborts and comes back into the game to fast, he spawns with broken leg and bleeding and unconscious and that happen really often when server is running 2h+ without restart ! you can see that by looking at the kill messages, if server is running 2h+ with 40/40 playerlimit and someone kills a player it takes ~30 seconds until the killmessage shows up, what means that it takes like 30 seconds to execute the server_playerdied.sqf and if people come back into game quicker than that delay they spawn with broken legs and stuff....
that is my onPauseScript:
Code:
private["_display","_btnRespawn","_btnAbort","_timeOut","_timeMax","_isDead"];
disableSerialization;
waitUntil {
_display = findDisplay 49;
!isNull _display;
};
sleep 1;
_btnRespawn = _display displayCtrl 1010;
_btnAbort = _display displayCtrl 104;
_btnRespawn ctrlEnable false;
_btnAbort ctrlEnable false;
_timeOut = 0;
_timeMax = 4;
if(r_player_dead) exitWith {_btnAbort ctrlEnable true;};
if(r_fracture_legs) exitWith {_btnRespawn ctrlEnable true;};
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"];
I tried so many things now but I couldnt manage to put a delay on abort button after death -.- please help me !!!