ACE3/addons/medical_status/functions/fnc_setDead.sqf

30 lines
700 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", "#setDead"]];
TRACE_2("setDead",_unit,_reason);
2016-10-12 21:20:22 +00:00
// 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];
_unit setVariable [QEGVAR(medical,causeOfDeath), _reason, true];
2016-10-12 21:20:22 +00:00
// Send a local event before death
[QEGVAR(medical,death), [_unit]] call CBA_fnc_localEvent;
2016-10-12 21:20:22 +00:00
// Kill the unit without changing visual apperance
[_unit, 1] call EFUNC(medical_engine,setStructuralDamage);