ACE3/addons/switchunits/functions/fnc_startSwitchUnits.sqf

34 lines
711 B
Plaintext
Raw Normal View History

2015-02-10 17:57:23 +00:00
/*
* Author: bux578
* Starts the SwitchUnits functionality
*
* Arguments:
* 0: player <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_player] call FUNC(startSwitchUnits)
*
* Public: No
*/
#include "script_component.hpp"
2015-05-09 11:49:26 +00:00
PARAMS_1(_player);
2015-02-10 17:57:23 +00:00
if (GVAR(EnableSwitchUnits)) then {
2015-05-09 11:49:26 +00:00
private "_sides";
2015-02-10 17:57:23 +00:00
_sides = [];
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);
};
};