From ec433a40a3e7e91445c533487c5af890d523bcb0 Mon Sep 17 00:00:00 2001 From: IT07 Date: Sat, 16 Apr 2016 23:39:13 +0200 Subject: [PATCH] Added additional params --- .../functions/fn_broadCast.sqf | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/exile_vemf_reloaded/functions/fn_broadCast.sqf b/exile_vemf_reloaded/functions/fn_broadCast.sqf index acdcff8..fd91d74 100644 --- a/exile_vemf_reloaded/functions/fn_broadCast.sqf +++ b/exile_vemf_reloaded/functions/fn_broadCast.sqf @@ -5,14 +5,16 @@ will alert players Params: - for global systemChat message: + for global(!) systemChat message: _this select 0: FORMATTED STRING - thing to send - _this select 1: STRING - mode to send to client + _this select 1: STRING - must be "sys" for mission announcement: + _this: ARRAY _this select 0: ARRAY _this select 0 select 0: FORMATTED STRING - Message line _this select 0 select 1: STRING - announcement title - _this select 1: STRING - must be empty + _this select 0 select 2: ARRAY - (optional) only send message to those units + _this select 1: STRING - (optional) must be empty or nil Returns: nothing @@ -26,12 +28,23 @@ if not(_msg isEqualTo "") then _mode = param [1, "", [""]]; if (count allPlayers > 0) then { + _targets = (_this select 0) param [2, [],[[]]]; + _broadCast = { - if (isPlayer _x) then { - VEMFrClientMsg = [_msg, _mode]; - (owner _x) publicVariableClient "VEMFrClientMsg"; - }; - } forEach allPlayers; + if (isPlayer _x) then + { + VEMFrClientMsg = [_msg, _mode]; + (owner _x) publicVariableClient "VEMFrClientMsg"; + }; + } forEach _this; + }; + if (count _targets isEqualTo 0) then + { + allPlayers call _broadCast; + } else + { + _targets call _broadCast; + }; }; };