a3_vemf_reloaded/exile_vemf_reloaded/sqf/broadCast.sqf

61 lines
1.5 KiB
Plaintext
Raw Normal View History

2016-05-10 12:19:40 +00:00
/*
Author: IT07
Description:
will alert players
Params:
for global(!) systemChat message:
_this select 0: FORMATTED STRING - thing to send
2016-05-26 13:58:05 +00:00
_this select 1: ARRAY - objects to send message to. If empty, broadcast will go to all players
_this select 2: STRING - must be "sys"
2016-05-10 12:19:40 +00:00
for mission announcement:
_this: ARRAY
_this select 0: ARRAY
2016-05-26 13:58:05 +00:00
_this select 0 select 0: SCALAR - broadcast type (determines the color of the message icon)
2016-05-10 12:19:40 +00:00
_this select 0 select 1: STRING - announcement title
2016-05-26 13:58:05 +00:00
_this select 0 select 2: FORMATTED STRING - Message line
_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"
2016-05-10 12:19:40 +00:00
Returns:
nothing
*/
2016-07-02 14:24:53 +00:00
_send =
2016-05-10 12:19:40 +00:00
{
2016-07-06 20:54:02 +00:00
private "_arr";
2016-07-02 14:24:53 +00:00
if (count _this isEqualTo 0) then
2016-05-10 12:19:40 +00:00
{
2016-07-02 14:24:53 +00:00
_arr = allPlayers;
} else
2016-05-26 13:58:05 +00:00
{
2016-07-02 14:24:53 +00:00
_arr = _this;
2016-05-26 13:58:05 +00:00
};
{
2016-07-02 14:24:53 +00:00
if (isPlayer _x AND alive _x) then
{
VEMFrMsgToClient = [_msg, _mode];
(owner _x) publicVariableClient "VEMFrMsgToClient";
};
} forEach _arr;
};
_to = param [1, [], [[]]];
if (_this select 0 isEqualType []) then // mission notification
{
_mode = (_this select 0) param [0, -1, [0]];
_title = (_this select 0) param [1, "DEFAULT TITLE", [""]];
_line = (_this select 0) param [2, "Default message", [""]];
_msg = [_mode, _title, _line];
_to call _send;
};
if (_this select 0 isEqualType "") then // systemchat broadcast
2016-05-26 13:58:05 +00:00
{
2016-07-02 14:24:53 +00:00
_mode = param [2, "", [""]];
_msg = param [0, "", [""]];
_to call _send;
2016-05-10 12:19:40 +00:00
};