ACE3/addons/interaction/functions/fnc_joinTeam.sqf

30 lines
648 B
Plaintext
Raw Permalink Normal View History

#include "..\script_component.hpp"
/*
* Author: commy2
2015-09-28 13:37:18 +00:00
* Unit joins a fire team.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Team <STRING>
* 2: Display hint <BOOL> (default: false)
*
2015-09-28 13:37:18 +00:00
* Return Value:
* None
*
* Example:
* [player, "YELLOW", false] call ace_interaction_fnc_joinTeam
*
* Public: No
*/
2015-01-11 19:32:51 +00:00
params ["_unit", "_team", ["_displayHint", false, [false]]];
2015-01-11 19:32:51 +00:00
_unit assignTeam _team;
2015-01-11 19:32:51 +00:00
2015-09-28 13:37:18 +00:00
// display message
if (_displayHint && {_unit == ACE_player}) then {
private _team = localize format ["str_team_%1", _team];
private _message = format [LLSTRING(JoinedTeam), _team];
[_message] call EFUNC(common,displayTextStructured);
2015-01-11 19:32:51 +00:00
};