change respawn button use warning to use ace_killed CBA event
All checks were successful
Generate testing snapshot / Create testing release (push) Successful in 41s
All checks were successful
Generate testing snapshot / Create testing release (push) Successful in 41s
This commit is contained in:
@@ -2,29 +2,29 @@
|
|||||||
|
|
||||||
if ( !hasInterface ) exitWith {};
|
if ( !hasInterface ) exitWith {};
|
||||||
|
|
||||||
player addEventHandler["Respawn",
|
["ace_killed", {
|
||||||
{
|
params ["_unit", "_causeOfDeath", "_killer", "_instigator"];
|
||||||
params ["_unit", "_corpse"];
|
|
||||||
private _killer = _corpse getVariable ["ace_medical_causeOfDeath", "#scripted"];
|
|
||||||
if (_killer == "respawn_button") then {
|
|
||||||
private _timeWentUnconscious = _corpse getVariable [QGVARMAIN(lastTimeKnockedOut), -1];
|
|
||||||
private _durationSpentUnconscious = -1;
|
|
||||||
if (_timeWentUnconscious > -1) then {
|
|
||||||
_durationSpentUnconscious = diag_tickTime - _timeWentUnconscious;
|
|
||||||
};
|
|
||||||
|
|
||||||
[
|
if (!local _unit) exitWith {};
|
||||||
LEVEL_INFO,
|
|
||||||
QUOTE(COMPONENT),
|
if (_causeOfDeath == "respawn_button") then {
|
||||||
"RESPAWNED WHILE UNCONSCIOUS",
|
private _timeWentUnconscious = _corpse getVariable [QGVARMAIN(lastTimeKnockedOut), -1];
|
||||||
[_unit, [
|
private _durationSpentUnconscious = -1;
|
||||||
["durationSpentUnconscious", _durationSpentUnconscious]
|
if (_timeWentUnconscious > -1) then {
|
||||||
]] call EFUNC(common,addPlayerInfoToArray)
|
_durationSpentUnconscious = diag_tickTime - _timeWentUnconscious;
|
||||||
] remoteExec [QEFUNC(common,log), 2];
|
|
||||||
// format["%1 was unconscious then clicked the respawn button", name _unit] remoteExec["systemChat", 0];
|
|
||||||
};
|
};
|
||||||
}
|
|
||||||
];
|
[
|
||||||
|
LEVEL_INFO,
|
||||||
|
QUOTE(COMPONENT),
|
||||||
|
"RESPAWNED WHILE UNCONSCIOUS",
|
||||||
|
[_unit, [
|
||||||
|
["durationSpentUnconscious", _durationSpentUnconscious]
|
||||||
|
]] call EFUNC(common,addPlayerInfoToArray)
|
||||||
|
] remoteExec [QEFUNC(common,log), 2];
|
||||||
|
// format["%1 was unconscious then clicked the respawn button", name _unit] remoteExec["systemChat", 0];
|
||||||
|
};
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user