2015-05-09 02:47:15 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Assigns a unit to the team
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Team <STRING>
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [target, "YELLOW"] call ace_interaction_fnc_joinTeam
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-11 23:13:47 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-05-09 20:14:00 +00:00
|
|
|
PARAMS_2(_unit,_team);
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-05-09 20:14:00 +00:00
|
|
|
private ["_message"];
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-01-11 23:13:47 +00:00
|
|
|
_unit setVariable [QGVAR(assignedFireTeam), _team, true];
|
2015-01-13 05:14:27 +00:00
|
|
|
[_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc);
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-01-12 04:20:02 +00:00
|
|
|
if (_unit == ACE_player) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
_message = if (_team == "MAIN") then {
|
2015-05-27 17:04:25 +00:00
|
|
|
localize STRING(LeftTeam);
|
2015-04-06 16:22:43 +00:00
|
|
|
} else {
|
2015-05-27 17:04:25 +00:00
|
|
|
_team = localize format [STRING(Team%1), _team];
|
|
|
|
format [localize STRING(JoinedTeam), _team];
|
2015-04-06 16:22:43 +00:00
|
|
|
};
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-04-06 16:22:43 +00:00
|
|
|
[_message] call EFUNC(common,displayTextStructured);
|
2015-01-11 19:32:51 +00:00
|
|
|
};
|