mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Regex used: \[(.+?),(.+?),(.+?)\]\s+call\s+E?FUNC\((common,)?(target|object)Event\) [$1,$3,$2] call CBA_fnc_targetEvent E?FUNC\((common,)?(server|global|local)Event\) CBA_fnc_$2Event E?FUNC\((common,)?(add|remove)EventHandler\) CBA_fnc_$2EventHandler
36 lines
721 B
Plaintext
36 lines
721 B
Plaintext
/*
|
|
* Author: commy2
|
|
* Unit joins a fire team.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
* 1: Team <STRING>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [player, "YELLOW"] call ace_interaction_fnc_joinTeam
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_unit", "_team"];
|
|
|
|
["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];
|
|
};
|
|
|
|
["displayTextStructured", _message] call CBA_fnc_localEvent;
|
|
};
|