2018-09-17 19:19:29 +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 {
|
2016-01-10 18:08:28 +00:00
|
|
|
private _sides = [];
|
2015-02-10 17:57:23 +00:00
|
|
|
|
|
|
|
if(GVAR(SwitchToWest)) then {_sides pushBack west;};
|
|
|
|
if(GVAR(SwitchToEast)) then {_sides pushBack east;};
|
|
|
|
if(GVAR(SwitchToIndependent)) then {_sides pushBack independent;};
|
|
|
|
if(GVAR(SwitchToCivilian)) then {_sides pushBack civilian;};
|
|
|
|
|
|
|
|
if (_player getVariable ["ACE_CanSwitchUnits", false]) then {
|
|
|
|
[_player, _sides] call FUNC(initPlayer);
|
|
|
|
};
|
|
|
|
};
|