ACE3/addons/respawn/functions/fnc_module.sqf
2015-09-26 16:32:29 +02:00

44 lines
1.0 KiB
Plaintext

/*
* 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
*/
#include "script_component.hpp"
params ["_logic", "_units", "_activated"];
if !(_activated) exitWith {};
GVAR(Module) = true;
[_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(RemoveDeadBodiesDisconnected), "RemoveDeadBodiesDisconnected"] call EFUNC(common,readSettingFromModule);
if (isServer && {GVAR(RemoveDeadBodiesDisconnected)}) then {
addMissionEventHandler ["HandleDisconnect", {
[{
params ["_unit"];
if (!alive _unit) then {
deleteVehicle _unit;
};
},
_this, 4] call EFUNC(common,waitAndExecute);
false
}];
};
ACE_LOGINFO("Respawn Module Initialized.");