2015-01-12 14:09:07 +00:00
|
|
|
/*
|
2015-02-02 22:28:27 +00:00
|
|
|
* Author: bux578
|
|
|
|
* Initializes the SwitchUnits pbo.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-12 14:09:07 +00:00
|
|
|
|
2015-01-13 09:53:04 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-02-03 20:47:48 +00:00
|
|
|
DFUNC(pfhClientInit) = {
|
|
|
|
|
|
|
|
if (GVAR(EnableSwitchUnits)) exitWith {
|
|
|
|
|
|
|
|
private ["_sides"];
|
|
|
|
_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;};
|
2015-01-13 09:53:04 +00:00
|
|
|
|
2015-02-03 20:47:48 +00:00
|
|
|
if (player getVariable ["ACE_CanSwitchUnits", false]) then {
|
|
|
|
[player, _sides] call FUNC(initPlayer);
|
|
|
|
};
|
|
|
|
|
|
|
|
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
|
|
|
};
|
2015-01-12 14:09:07 +00:00
|
|
|
};
|
2015-02-03 20:47:48 +00:00
|
|
|
|
|
|
|
[FUNC(pfhClientInit), 0.5, []] call cba_fnc_addPerFrameHandler;
|