2015-09-26 14:26:41 +00:00
|
|
|
/*
|
|
|
|
* Author: KoffeinFlummi, bux578, esteldunedain, commy2
|
|
|
|
* Initializes the respawn module.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Logic <OBJECT>
|
|
|
|
* 1: Synced units <ARRAY>
|
|
|
|
* 2: Activated <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [logic, [ACE_Player], true] call ace_respawn_fnc_module
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-12 10:24:58 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-09-26 14:26:41 +00:00
|
|
|
params ["_logic", "_units", "_activated"];
|
2015-01-12 09:07:03 +00:00
|
|
|
|
|
|
|
if !(_activated) exitWith {};
|
|
|
|
|
2015-01-12 09:49:21 +00:00
|
|
|
GVAR(Module) = true;
|
2015-01-12 09:07:03 +00:00
|
|
|
|
2015-02-03 05:53:02 +00:00
|
|
|
[_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(common,readSettingFromModule);
|
|
|
|
[_logic, QGVAR(RemoveDeadBodiesDisconnected), "RemoveDeadBodiesDisconnected"] call EFUNC(common,readSettingFromModule);
|
2015-01-12 09:07:03 +00:00
|
|
|
|
2015-09-26 14:26:41 +00:00
|
|
|
if (isServer && {GVAR(RemoveDeadBodiesDisconnected)}) then {
|
|
|
|
addMissionEventHandler ["HandleDisconnect", {
|
|
|
|
[{
|
|
|
|
params ["_unit"];
|
|
|
|
|
|
|
|
if (!alive _unit) then {
|
|
|
|
deleteVehicle _unit;
|
|
|
|
};
|
|
|
|
},
|
|
|
|
_this, 4] call EFUNC(common,waitAndExecute);
|
|
|
|
false
|
|
|
|
}];
|
2015-01-12 09:07:03 +00:00
|
|
|
};
|
|
|
|
|
2015-08-26 13:20:11 +00:00
|
|
|
ACE_LOGINFO("Respawn Module Initialized.");
|