2015-01-12 10:24:58 +00:00
|
|
|
/*
|
|
|
|
Name: ACE_Respawn_fnc_module
|
2015-02-03 05:53:02 +00:00
|
|
|
|
2015-01-12 10:24:58 +00:00
|
|
|
Author(s):
|
2015-03-24 04:18:00 +00:00
|
|
|
KoffeinFlummi, bux578, esteldunedain, commy2
|
2015-02-03 05:53:02 +00:00
|
|
|
|
2015-01-12 10:24:58 +00:00
|
|
|
Description:
|
|
|
|
initializes the respawn module
|
2015-02-03 05:53:02 +00:00
|
|
|
|
2015-01-12 10:24:58 +00:00
|
|
|
Parameters:
|
|
|
|
0: OBJECT - logic
|
|
|
|
1: ARRAY<OBJECT> - synced units
|
|
|
|
2: BOOLEAN - activated
|
2015-02-03 05:53:02 +00:00
|
|
|
|
2015-01-12 10:24:58 +00:00
|
|
|
Returns:
|
|
|
|
VOID
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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-17 23:13:09 +00:00
|
|
|
private "_fnc_deleteDisconnected";
|
2015-01-13 14:28:03 +00:00
|
|
|
_fnc_deleteDisconnected = {
|
|
|
|
_this spawn {
|
2015-04-17 23:13:09 +00:00
|
|
|
PARAMS_1(_unit);
|
2015-01-13 14:28:03 +00:00
|
|
|
|
|
|
|
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.";
|