Skip to content

Commit

Permalink
Move chat channels ids to defines
Browse files Browse the repository at this point in the history
  • Loading branch information
veteran29 committed Aug 14, 2024
1 parent 32c5f66 commit b4126f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addons/chat/functions/fnc_handleChatMessage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
params [["_channel", -1], "", ["_from", ""], ["_text", ""], ["_sender", objNull]];
if (_text == "") exitWith {false};

if (GVAR(allowGlobalChat) || {!(_channel in [0, 1])}) exitWith {false};
if (GVAR(allowGlobalChat) || {!(_channel in RESTRICTED_CHANNELS)}) exitWith {false};

if (_sender getVariable [QEGVAR(common,isAdmin), false]) exitWith {
[format ["(ADMIN) %1", _from], _text]
Expand Down
4 changes: 4 additions & 0 deletions addons/chat/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
#endif

#include "\z\afm\addons\main\script_macros.hpp"

#define CHAT_CHANNEL_GLOBAL 0
#define CHAT_CHANNEL_SIDE 1
#define RESTRICTED_CHANNELS [CHAT_CHANNEL_GLOBAL, CHAT_CHANNEL_SIDE]

0 comments on commit b4126f7

Please sign in to comment.