mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
028a0cb3f0
* Added ability to suppress hint message * Adjustments based on request
38 lines
839 B
Plaintext
38 lines
839 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: commy2
|
|
* Unit joins a fire team.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
* 1: Team <STRING>
|
|
* 2: Display hint <BOOL> (default: false)
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [player, "YELLOW", false] call ace_interaction_fnc_joinTeam
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_unit", "_team", ["_displayHint", false, [false]]];
|
|
|
|
["CBA_teamColorChanged", [_unit, _team]] call CBA_fnc_globalEvent;
|
|
|
|
// display message
|
|
if (_unit == ACE_player) then {
|
|
private _message = "";
|
|
|
|
if (_team == "MAIN") then {
|
|
_message = localize LSTRING(LeftTeam);
|
|
} else {
|
|
_team = localize format [LSTRING(Team%1), _team];
|
|
_message = format [localize LSTRING(JoinedTeam), _team];
|
|
};
|
|
if (_displayHint) then {
|
|
[_message] call EFUNC(common,displayTextStructured);
|
|
};
|
|
};
|