ACE3/addons/respawn/functions/fnc_handleKilled.sqf

34 lines
792 B
Plaintext
Raw Normal View History

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
*/
#include "script_component.hpp"
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
2015-09-26 14:26:41 +00:00
if (ACE_player == _unit) then {
2015-06-04 12:30:38 +00:00
GVAR(unitGear) = [];
2015-01-12 09:07:03 +00:00
2015-06-04 12:30:38 +00:00
if (GVAR(SavePreDeathGear)) then {
2015-09-26 14:26:41 +00:00
GVAR(unitGear) = [_unit] call EFUNC(common,getAllGear);
GVAR(unitGear) append [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit];
2015-06-04 12:30:38 +00:00
};
2015-01-12 09:07:03 +00:00
};
2015-01-12 09:49:21 +00:00
if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then {
[_this, QUOTE(DFUNC(showFriendlyFireMessage)), 2] call EFUNC(common,execRemoteFnc);
2015-01-12 09:07:03 +00:00
};