2015-01-12 10:24:58 +00:00
|
|
|
/*
|
2015-04-26 19:26:57 +00:00
|
|
|
Name: ACE_Respawn_fnc_module
|
2015-02-03 05:53:02 +00:00
|
|
|
|
2015-04-26 19:26:57 +00:00
|
|
|
Author(s):
|
|
|
|
KoffeinFlummi, bux578, esteldunedain, commy2
|
2015-02-03 05:53:02 +00:00
|
|
|
|
2015-04-26 19:26:57 +00:00
|
|
|
Description:
|
|
|
|
initializes the respawn module
|
2015-02-03 05:53:02 +00:00
|
|
|
|
2015-04-26 19:26:57 +00:00
|
|
|
Parameters:
|
|
|
|
0: OBJECT - logic
|
|
|
|
1: ARRAY<OBJECT> - synced units
|
|
|
|
2: BOOLEAN - activated
|
2015-02-03 05:53:02 +00:00
|
|
|
|
2015-04-26 19:26:57 +00:00
|
|
|
Returns:
|
|
|
|
VOID
|
2015-01-12 10:24:58 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-04-17 23:13:09 +00:00
|
|
|
PARAMS_3(_logic,_units,_activated);
|
2015-01-12 09:07:03 +00:00
|
|
|
|
2015-04-17 23:13:09 +00:00
|
|
|
if !(isServer) exitWith {};
|
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
|
|
|
|
|
|
|
if (isServer) then {
|
2015-01-14 01:32:27 +00:00
|
|
|
if (GVAR(RemoveDeadBodiesDisconnected)) then {
|
2015-04-11 17:36:38 +00:00
|
|
|
addMissionEventHandler ["HandleDisconnect", {
|
|
|
|
[{
|
2015-04-17 23:13:09 +00:00
|
|
|
PARAMS_1(_unit);
|
2015-01-13 14:28:03 +00:00
|
|
|
|
|
|
|
if (!alive _unit) then {
|
|
|
|
deleteVehicle _unit;
|
|
|
|
};
|
2015-04-10 13:23:27 +00:00
|
|
|
},
|
2015-04-11 17:36:38 +00:00
|
|
|
_this, 4, 1] call EFUNC(common,waitAndExecute);
|
2015-01-13 14:28:03 +00:00
|
|
|
false
|
2015-04-11 17:36:38 +00:00
|
|
|
}];
|
2015-01-13 14:28:03 +00:00
|
|
|
};
|
2015-01-12 09:07:03 +00:00
|
|
|
};
|
|
|
|
|
2015-01-12 09:49:21 +00:00
|
|
|
diag_log text "[ACE]: Respawn Module Initialized.";
|