ACE3/addons/interaction/functions/fnc_joinTeam.sqf

36 lines
756 B
Plaintext
Raw Normal View History

/*
* 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
if (_unit == ACE_player) then {
_message = if (_team == "MAIN") then {
2015-05-28 19:59:04 +00:00
localize LSTRING(LeftTeam);
} else {
2015-05-28 19:59:04 +00:00
_team = localize format [LSTRING(Team%1), _team];
format [localize LSTRING(JoinedTeam), _team];
};
2015-01-11 19:32:51 +00:00
[_message] call EFUNC(common,displayTextStructured);
2015-01-11 19:32:51 +00:00
};