mirror of
https://github.com/IT07/a3_vemf_reloaded.git
synced 2024-08-30 16:52:11 +00:00
Rewritten
This commit is contained in:
parent
67bfc72dab
commit
095b313821
@ -7,44 +7,57 @@
|
|||||||
Params:
|
Params:
|
||||||
for global(!) systemChat message:
|
for global(!) systemChat message:
|
||||||
_this select 0: FORMATTED STRING - thing to send
|
_this select 0: FORMATTED STRING - thing to send
|
||||||
_this select 1: STRING - must be "sys"
|
_this select 1: ARRAY - objects to send message to. If empty, broadcast will go to all players
|
||||||
|
_this select 2: STRING - must be "sys"
|
||||||
for mission announcement:
|
for mission announcement:
|
||||||
_this: ARRAY
|
_this: ARRAY
|
||||||
_this select 0: ARRAY
|
_this select 0: ARRAY
|
||||||
_this select 0 select 0: FORMATTED STRING - Message line
|
_this select 0 select 0: SCALAR - broadcast type (determines the color of the message icon)
|
||||||
_this select 0 select 1: STRING - announcement title
|
_this select 0 select 1: STRING - announcement title
|
||||||
_this select 0 select 2: ARRAY - (optional) only send message to those units
|
_this select 0 select 2: FORMATTED STRING - Message line
|
||||||
_this select 1: STRING - (optional) must be empty or nil
|
_this select 1: ARRAY - objects to send message to. If empty, broadcast will go to all players
|
||||||
|
_this select 2: STRING - (optional) must be empty or nil | for systemChat broadcast, use "sys"
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
nothing
|
nothing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private ["_msg"];
|
if (_this isEqualType []) then
|
||||||
_msg = param [0, "", [[],format[""]]];
|
|
||||||
if not(_msg isEqualTo "") then
|
|
||||||
{
|
{
|
||||||
private ["_mode"];
|
|
||||||
_mode = param [1, "", [""]];
|
|
||||||
if (count allPlayers > 0) then
|
|
||||||
{
|
|
||||||
_targets = (_this select 0) param [2, [],[[]]];
|
|
||||||
_broadCast =
|
_broadCast =
|
||||||
{
|
{
|
||||||
|
private ["_arr"];
|
||||||
|
if (count _this isEqualTo 0) then
|
||||||
|
{
|
||||||
|
_arr = allPlayers;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
_arr = _this;
|
||||||
|
};
|
||||||
{
|
{
|
||||||
if (isPlayer _x AND alive _x) then
|
if (isPlayer _x AND alive _x) then
|
||||||
{
|
{
|
||||||
VEMFrClientMsg = [_msg, _mode];
|
VEMFrMsgToClient = [_msg, _mode];
|
||||||
(owner _x) publicVariableClient "VEMFrClientMsg";
|
(owner _x) publicVariableClient "VEMFrMsgToClient";
|
||||||
};
|
};
|
||||||
} forEach _this;
|
} forEach _arr;
|
||||||
};
|
};
|
||||||
if (count _targets isEqualTo 0) then
|
_targets = param [1, [], [[]]];
|
||||||
{
|
_mode = param [2, "", [""]];
|
||||||
allPlayers call _broadCast;
|
if (_this select 0 isEqualType []) then
|
||||||
} else
|
|
||||||
{
|
{
|
||||||
|
_mode = (_this select 0) param [0, -1, [0]];
|
||||||
|
_title = (_this select 0) param [1, "DEFAULT TITLE", [""]];
|
||||||
|
_msgLine = (_this select 0) param [2, "Default message", [""]];
|
||||||
|
_msg = [_mode, _title, _msgLine];
|
||||||
_targets call _broadCast;
|
_targets call _broadCast;
|
||||||
};
|
};
|
||||||
|
if (_this select 0 isEqualType "") then
|
||||||
|
{
|
||||||
|
_msg = param [0, "", [""]];
|
||||||
|
_targets call _broadCast;
|
||||||
};
|
};
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
["broadcast.sqf", 0, format["_this is not an ARRAY: %1", _this]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user