ACE3/addons/respawn/functions/fnc_handleKilled.sqf
BrettMayson 438a90b63d
Common - Add CBA extended loadout (#8923)
* extended loadouts - earplugs, gunbag, and arsenal identity

* arsenal - maintain default loadout size check

* restore comment

Co-authored-by: jonpas <jonpas33@gmail.com>

* fix forgotten example

Co-authored-by: jonpas <jonpas33@gmail.com>
2022-08-25 11:56:54 -05:00

31 lines
823 B
Plaintext

#include "script_component.hpp"
/*
* 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
*/
params ["_unit"];
// 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]];
[QGVAR(saveGear), _unit] call CBA_fnc_localEvent;
};
if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then {
[QGVAR(showFriendlyFireMessageEvent), _this] call CBA_fnc_globalEvent;
};