Skip to content

Commit 6c6cf17

Browse files
belomaxorkaclaude
andcommitted
Add mp_show_hintmessages cvar to block hint messages server-side
Allows servers to suppress all Hint_* messages (HintMessageEx queue) without a plugin. Default 1 keeps vanilla behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 6799732 commit 6c6cf17

5 files changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
7474
| mp_show_radioicon | 1 | 0 | 1 | Show radio icon.<br/>`0` disabled<br/>`1` enabled |
7575
| mp_show_scenarioicon | 0 | 0 | 1 | Show scenario icon in HUD such as count of alive hostages or ticking bomb.<br/>`0` disabled<br/>`1` enabled |
7676
| mp_show_bomb_timer | 0 | 0 | 1 | Show the time until the planted bomb explodes on the HUD round timer.<br/>`0` disabled<br/>`1` enabled (when the bomb is planted, the round timer shows the C4 countdown) |
77+
| mp_show_hintmessages | 1 | 0 | 1 | Send hint messages (Hint_*) to clients.<br/>`0` disabled (hints are blocked server-side)<br/>`1` enabled |
7778
| mp_old_bomb_defused_sound | 1 | 0 | 1 | Play "Bomb has been defused" sound instead of "Counter-Terrorists win" when bomb was defused<br/>`0` disabled<br/>`1` enabled |
7879
| showtriggers | 0 | 0 | 1 | Debug cvar shows triggers. |
7980
| sv_alltalk | 0 | 0 | 5 | When players can hear each other ([further explanation](../../wiki/sv_alltalk)).<br/>`0` dead don't hear alive<br/>`1` no restrictions<br/>`2` teammates hear each other<br/>`3` Same as 2, but spectators hear everybody<br/>`4` alive hear alive, dead hear dead and alive.<br/>`5` alive hear alive teammates, dead hear dead and alive.

dist/game.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,13 @@ mp_show_scenarioicon "0"
206206
// Default value: "0"
207207
mp_show_bomb_timer "0"
208208
209+
// Send hint messages (Hint_*) to clients.
210+
// 0 - disabled (hints are blocked server-side)
211+
// 1 - enabled (default behavior)
212+
//
213+
// Default value: "1"
214+
mp_show_hintmessages "1"
215+
209216
// Play "Bomb has been defused" sound instead of "Counter-Terrorists win" when bomb was defused
210217
// 0 - disabled (default behavior)
211218
// 1 - enabled

regamedll/dlls/game.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ cvar_t roundover = { "mp_roundover", "0", FCVAR_SERVER, 0.0f,
128128
cvar_t forcerespawn = { "mp_forcerespawn", "0", FCVAR_SERVER, 0.0f, nullptr };
129129
cvar_t show_radioicon = { "mp_show_radioicon", "1", 0, 1.0f, nullptr };
130130
cvar_t show_scenarioicon = { "mp_show_scenarioicon", "0", FCVAR_SERVER, 0.0f, nullptr };
131+
cvar_t show_hintmessages = { "mp_show_hintmessages", "1", 0, 1.0f, nullptr };
131132
cvar_t old_bomb_defused_sound = { "mp_old_bomb_defused_sound", "1", 0, 1.0f, nullptr };
132133
cvar_t item_staytime = { "mp_item_staytime", "300", FCVAR_SERVER, 300.0f, nullptr };
133134
cvar_t legacy_bombtarget_touch = { "mp_legacy_bombtarget_touch", "1", 0, 1.0f, nullptr };
@@ -417,6 +418,7 @@ void EXT_FUNC GameDLLInit()
417418
CVAR_REGISTER(&show_scenarioicon);
418419
}
419420

421+
CVAR_REGISTER(&show_hintmessages);
420422
CVAR_REGISTER(&old_bomb_defused_sound);
421423
CVAR_REGISTER(&item_staytime);
422424
CVAR_REGISTER(&legacy_bombtarget_touch);

regamedll/dlls/game.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ extern cvar_t roundover;
157157
extern cvar_t forcerespawn;
158158
extern cvar_t show_radioicon;
159159
extern cvar_t show_scenarioicon;
160+
extern cvar_t show_hintmessages;
160161
extern cvar_t old_bomb_defused_sound;
161162
extern cvar_t item_staytime;
162163
extern cvar_t legacy_bombtarget_touch;

regamedll/dlls/player.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8108,6 +8108,11 @@ LINK_HOOK_CLASS_CHAIN(bool, CBasePlayer, HintMessageEx, (const char *pMessage, f
81088108

81098109
bool EXT_FUNC CBasePlayer::__API_HOOK(HintMessageEx)(const char *pMessage, float duration, bool bDisplayIfPlayerDead, bool bOverride)
81108110
{
8111+
#ifdef REGAMEDLL_ADD
8112+
if (show_hintmessages.value == 0.0f)
8113+
return false;
8114+
#endif
8115+
81118116
if (!bDisplayIfPlayerDead && !IsAlive())
81128117
return false;
81138118

0 commit comments

Comments
 (0)