Files
RangerMetrics/@RangerMetrics/addons/RangerMetrics/functions/fn_log.sqf
2023-04-07 01:40:42 -07:00

27 lines
714 B
Plaintext

params [["_text","Log text invalid",[""]], ["_type","INFO",[""]]];
private _textFormatted = format [
"[%1] %2: %3",
RangerMetrics_logPrefix,
_type,
_text];
if(isServer) then {
diag_log text _textFormatted;
if(isMultiplayer) then {
_playerIds = [];
{
_player = _x;
_ownerId = owner _player;
if(_ownerId > 0) then {
if(getPlayerUID _player in ["76561198013533294"]) then {
_playerIds pushBack _ownerId;
};
};
} foreach allPlayers;
if(count _playerIds > 0) then {
[_textFormatted] remoteExec ["diag_log", _playerIds];
};
};
};