2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-02-10 17:57:23 +00:00
|
|
|
/*
|
|
|
|
* Author: bux578
|
|
|
|
* Starts the SwitchUnits functionality
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: player <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-08-07 07:18:42 +00:00
|
|
|
* [_player] call ace_switchunits_fnc_startSwitchUnits
|
2015-02-10 17:57:23 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-07 07:18:42 +00:00
|
|
|
params ["_player"];
|
2015-02-10 17:57:23 +00:00
|
|
|
|
|
|
|
if (GVAR(EnableSwitchUnits)) then {
|
2020-06-07 23:25:11 +00:00
|
|
|
GVAR(switchableSides) = [];
|
2015-02-10 17:57:23 +00:00
|
|
|
|
2020-06-07 23:25:11 +00:00
|
|
|
if (GVAR(SwitchToWest)) then {GVAR(switchableSides) pushBack west;};
|
|
|
|
if (GVAR(SwitchToEast)) then {GVAR(switchableSides) pushBack east;};
|
|
|
|
if (GVAR(SwitchToIndependent)) then {GVAR(switchableSides) pushBack independent;};
|
|
|
|
if (GVAR(SwitchToCivilian)) then {GVAR(switchableSides) pushBack civilian;};
|
2015-02-10 17:57:23 +00:00
|
|
|
|
|
|
|
if (_player getVariable ["ACE_CanSwitchUnits", false]) then {
|
2020-06-07 23:25:11 +00:00
|
|
|
[_player] call FUNC(initPlayer);
|
2015-02-10 17:57:23 +00:00
|
|
|
};
|
|
|
|
};
|