ACE3/addons/switchunits/functions/fnc_startSwitchUnits.sqf

32 lines
774 B
Plaintext
Raw Normal View History

#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 {
GVAR(switchableSides) = [];
2015-02-10 17:57:23 +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 {
[_player] call FUNC(initPlayer);
2015-02-10 17:57:23 +00:00
};
};