2015-01-16 23:21:47 +00:00
|
|
|
/**
|
|
|
|
* fn_sendMessageTo.sqf
|
|
|
|
* @Descr: Sends a chat message to player unit across the network
|
|
|
|
* @Author: Glowbal
|
|
|
|
*
|
|
|
|
* @Arguments: [reciever OBJECT, message STRING]
|
|
|
|
* @Return: void
|
|
|
|
* @PublicAPI: true
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_reciever","_message"];
|
|
|
|
_reciever = _this select 0;
|
|
|
|
_message = _this select 1;
|
|
|
|
|
|
|
|
|
|
|
|
if (isPlayer _reciever) then {
|
|
|
|
if (!local _reciever) then {
|
2015-01-17 12:03:51 +00:00
|
|
|
[_this, QUOTE(FUNC(sendMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc);
|
2015-01-16 23:21:47 +00:00
|
|
|
} else {
|
2015-01-17 12:03:51 +00:00
|
|
|
if (isnil QGVAR(LOGIC_OBJECT)) exitwith {
|
|
|
|
// need to create an object instead
|
|
|
|
};
|
|
|
|
|
|
|
|
if (isLocalized _message) then {
|
|
|
|
_message = localize _message;
|
|
|
|
};
|
2015-01-16 23:21:47 +00:00
|
|
|
GVAR(LOGIC_OBJECT) globalChat format ["%1",_message];
|
|
|
|
};
|
|
|
|
};
|