ACE3/addons/respawn/functions/fnc_handleKilled.sqf

31 lines
826 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2015-01-12 09:07:03 +00:00
/*
2015-09-26 14:26:41 +00:00
* Author: bux578
* Handles the XEH killed event.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Killer <OBJECT>
*
* Return Value:
* None
*
* Example:
* [ACE_player, bad_dude] call ace_respawn_fnc_handleKilled
*
* Public: No
*/
2015-09-26 14:26:41 +00:00
params ["_unit"];
2015-01-12 09:07:03 +00:00
2015-06-04 12:30:38 +00:00
// Saves the gear when the player! (and only him) is killed
if (ACE_player == _unit && {GVAR(SavePreDeathGear)}) then {
_unit setVariable [QGVAR(unitGear), [_unit] call CBA_fnc_getLoadout];
_unit setVariable [QGVAR(activeWeaponAndMuzzle), [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit]];
2020-04-04 15:24:59 +00:00
[QGVAR(saveGear), _unit] call CBA_fnc_localEvent;
2015-01-12 09:07:03 +00:00
};
2015-01-12 09:49:21 +00:00
if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then {
2016-06-03 00:59:18 +00:00
[QGVAR(showFriendlyFireMessageEvent), _this] call CBA_fnc_globalEvent;
2015-01-12 09:07:03 +00:00
};