ACE3/addons/respawn/functions/fnc_module.sqf

53 lines
1.2 KiB
Plaintext
Raw Normal View History

/*
Name: ACE_Respawn_fnc_module
Author(s):
KoffeinFlummi, bux578, CAA-Picard, commy2
Description:
initializes the respawn module
Parameters:
0: OBJECT - logic
1: ARRAY<OBJECT> - synced units
2: BOOLEAN - activated
Returns:
VOID
*/
#include "script_component.hpp"
2015-01-12 09:07:03 +00:00
if !(isServer) exitWith {};
_logic = _this select 0;
_activated = _this select 2;
if !(_activated) exitWith {};
2015-01-12 09:49:21 +00:00
GVAR(Module) = true;
2015-01-12 09:07:03 +00:00
2015-01-13 15:29:35 +00:00
[_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(common,readBooleanParameterFromModule);
2015-01-14 01:32:27 +00:00
[_logic, QGVAR(RemoveDeadBodiesDisconnected), "RemoveDeadBodiesDisconnected"] call EFUNC(common,readBooleanParameterFromModule);
2015-01-12 09:07:03 +00:00
if (isServer) then {
2015-01-14 01:32:27 +00:00
if (GVAR(RemoveDeadBodiesDisconnected)) then {
2015-01-13 14:28:03 +00:00
_fnc_deleteDisconnected = {
_this spawn {
_unit = _this select 0;
sleep 4;
if (!alive _unit) then {
deleteVehicle _unit;
};
};
false
2015-01-12 09:49:21 +00:00
};
2015-01-13 14:28:03 +00:00
addMissionEventHandler ["HandleDisconnect", _fnc_deleteDisconnected];
};
2015-01-12 09:07:03 +00:00
};
2015-01-12 09:49:21 +00:00
diag_log text "[ACE]: Respawn Module Initialized.";