2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-05-09 02:47:15 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
2015-09-28 13:37:18 +00:00
|
|
|
* Unit joins a fire team.
|
2015-05-09 02:47:15 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Team <STRING>
|
|
|
|
*
|
2015-09-28 13:37:18 +00:00
|
|
|
* Return Value:
|
2015-05-09 02:47:15 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-09-28 13:37:18 +00:00
|
|
|
* [player, "YELLOW"] call ace_interaction_fnc_joinTeam
|
2015-05-09 02:47:15 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-09-28 13:37:18 +00:00
|
|
|
params ["_unit", "_team"];
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2016-05-25 18:23:53 +00:00
|
|
|
["CBA_teamColorChanged", [_unit, _team]] call CBA_fnc_globalEvent;
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-09-28 13:37:18 +00:00
|
|
|
// display message
|
2015-01-12 04:20:02 +00:00
|
|
|
if (_unit == ACE_player) then {
|
2017-10-10 14:39:59 +00:00
|
|
|
private _message = "";
|
2015-09-28 13:37:18 +00:00
|
|
|
|
|
|
|
if (_team == "MAIN") then {
|
|
|
|
_message = localize LSTRING(LeftTeam);
|
2015-04-06 16:22:43 +00:00
|
|
|
} else {
|
2015-05-28 19:59:04 +00:00
|
|
|
_team = localize format [LSTRING(Team%1), _team];
|
2015-09-28 13:37:18 +00:00
|
|
|
_message = format [localize LSTRING(JoinedTeam), _team];
|
2015-04-06 16:22:43 +00:00
|
|
|
};
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2016-06-04 10:12:56 +00:00
|
|
|
[_message] call EFUNC(common,displayTextStructured);
|
2015-01-11 19:32:51 +00:00
|
|
|
};
|