2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-02-10 17:40:06 +00:00
|
|
|
/*
|
|
|
|
* Author: bux578
|
|
|
|
* Initializes the SwitchUnits pbo.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-06-02 17:06:41 +00:00
|
|
|
|
2015-02-10 17:57:23 +00:00
|
|
|
if (missionNamespace getVariable [QGVAR(EnableSwitchUnits), false]) then {
|
|
|
|
[player] call FUNC(startSwitchUnits);
|
|
|
|
} else {
|
2021-10-11 20:48:30 +00:00
|
|
|
["CBA_SettingChanged", {
|
2017-10-10 14:39:59 +00:00
|
|
|
params ["_name", "_value"];
|
2015-02-10 17:57:23 +00:00
|
|
|
if ((_name == QGVAR(EnableSwitchUnits)) && {_value}) then {
|
|
|
|
[player] call FUNC(startSwitchUnits);
|
2015-02-10 17:40:06 +00:00
|
|
|
};
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2015-02-10 17:40:06 +00:00
|
|
|
};
|
2016-05-21 17:59:44 +00:00
|
|
|
|
|
|
|
if (isServer) then {
|
|
|
|
[QGVAR(switchLocality), {
|
|
|
|
params ["_unit", "_player"];
|
|
|
|
_unit setVariable [QGVAR(OriginalOwner), owner _unit, true];
|
|
|
|
_unit setOwner (owner _player);
|
2016-06-03 00:59:18 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2016-05-21 17:59:44 +00:00
|
|
|
};
|