ACE3/addons/respawn/functions/fnc_module.sqf

57 lines
1.3 KiB
Plaintext
Raw Normal View History

/*
Name: ACE_Respawn_fnc_module
2015-02-03 05:53:02 +00:00
Author(s):
2015-03-24 04:18:00 +00:00
KoffeinFlummi, bux578, esteldunedain, commy2
2015-02-03 05:53:02 +00:00
Description:
initializes the respawn module
2015-02-03 05:53:02 +00:00
Parameters:
0: OBJECT - logic
1: ARRAY<OBJECT> - synced units
2: BOOLEAN - activated
2015-02-03 05:53:02 +00:00
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-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-01-13 14:28:03 +00:00
_fnc_deleteDisconnected = {
[
{
_unit = (_this select 0) select 0;
2015-01-13 14:28:03 +00:00
if (!alive _unit) then {
2015-01-13 14:28:03 +00:00
deleteVehicle _unit;
[_this select 0] call CBA_fnc_removePerFrameHandler;
};
},
4,
[_this]
] call CBA_fnc_addPerFrameHandler
2015-01-13 14:28:03 +00:00
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.";