2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-02-02 22:28:27 +00:00
|
|
|
* Author: bux578
|
|
|
|
* Initializes the player
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: player <OBJECT>
|
|
|
|
* 1: sides <ARRAY<OBJECT>>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-08-07 07:18:42 +00:00
|
|
|
* [player, [west]] call ace_switchunits_fnc_initPlayer
|
2015-02-02 22:28:27 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-12 14:47:22 +00:00
|
|
|
|
2015-08-07 07:18:42 +00:00
|
|
|
params ["_playerUnit", "_sides"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
if (vehicle _playerUnit == _playerUnit) then {
|
2015-02-03 20:47:48 +00:00
|
|
|
[_sides] call FUNC(markAiOnMap);
|
|
|
|
|
2016-01-10 19:58:54 +00:00
|
|
|
_playerUnit setVariable [QGVAR(IsPlayerUnit), true, true];
|
2015-02-03 20:47:48 +00:00
|
|
|
_playerUnit allowDamage false;
|
|
|
|
|
|
|
|
GVAR(OriginalUnit) = _playerUnit;
|
|
|
|
GVAR(OriginalName) = name _playerUnit;
|
|
|
|
GVAR(OriginalGroup) = group _playerUnit;
|
|
|
|
|
|
|
|
// remove all starting gear of a player
|
|
|
|
removeAllWeapons _playerUnit;
|
|
|
|
removeGoggles _playerUnit;
|
|
|
|
removeHeadgear _playerUnit;
|
|
|
|
removeAllAssignedItems _playerUnit;
|
2018-10-10 01:21:46 +00:00
|
|
|
removeAllContainers _playerUnit;
|
2015-02-03 20:47:48 +00:00
|
|
|
_playerUnit linkItem "ItemMap";
|
|
|
|
|
2016-01-19 15:34:59 +00:00
|
|
|
[_playerUnit, "forceWalk", "ACE_SwitchUnits", true] call EFUNC(common,statusEffect_set);
|
2015-02-03 20:47:48 +00:00
|
|
|
|
|
|
|
[_playerUnit, _sides] call FUNC(addMapFunction);
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|