ACE3/addons/medical_status/functions/fnc_setDead.sqf

29 lines
770 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
2016-10-12 21:20:22 +00:00
/*
* Author: commy2
* Kills a local unit.
*
* Arguments:
* 0: The unit <OBJECT>
* 1: Reason for death <STRING>
*
* Return Value:
2016-10-12 21:20:22 +00:00
* None
*
* Public: No
*/
params ["_unit", ["_reason", "unknown"]];
// No heart rate or blood pressure to measure when dead
_unit setVariable [VAR_HEART_RATE, 0, true];
_unit setVariable [VAR_BLOOD_PRESS, [0, 0], true];
// Kill the unit without changing visual apperance
[_unit, 1] call EFUNC(medical_engine,setStructuralDamage);
2016-10-12 21:20:22 +00:00
private _lastShooter = _unit getVariable [QEGVAR(medical,lastDamageSource), objNull];
private _lastInstigator = _unit getVariable [QEGVAR(medical,lastInstigator), objNull];
2016-10-12 21:20:22 +00:00
["ace_killed", [_unit, _reason, _lastShooter, _lastInstigator]] call CBA_fnc_globalEvent;