ACE3/addons/medical/functions/fnc_setDead.sqf
AkiraforARMA ed1e95106d Priority ERROR units never die possibility (#5526)
* Priority ERROR units never die possibility

Cases when _lifesLeft goes below 0. 
Low or limb damage, then recovered with PAK from unconcious & revivestate.

* Update fnc_setDead.sqf
2017-10-10 11:06:07 -05:00

28 lines
706 B
Plaintext

/*
* Author: commy2
* Kills a local unit.
*
* Arguments:
* 0: The unit <OBJECT>
* 1: Reason for death <STRING>
*
* Return Value:
* None
*
* Example:
* [bob, "bloodloss"] call ace_medical_fnc_setDead;
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", ["_reason", "unknown"]];
// wait a frame to escape handleDamage
[EFUNC(medical_engine,setStructuralDamage), [_unit, 1]] call CBA_fnc_execNextFrame;
private _lastShooter = _unit getVariable [QEGVAR(medical_engine,lastShooter), objNull];
private _lastInstigator = _unit getVariable [QEGVAR(medical_engine,lastInstigator), objNull];
["ace_killed", [_unit, _reason, _lastShooter, _lastInstigator]] call CBA_fnc_globalEvent;