diff --git a/README.md b/README.md index d224265e1..5dc3274c7 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_show_radioicon | 1 | 0 | 1 | Show radio icon.
`0` disabled
`1` enabled | | mp_show_scenarioicon | 0 | 0 | 1 | Show scenario icon in HUD such as count of alive hostages or ticking bomb.
`0` disabled
`1` enabled | | mp_show_bomb_timer | 0 | 0 | 1 | Show the time until the planted bomb explodes on the HUD round timer.
`0` disabled
`1` enabled (when the bomb is planted, the round timer shows the C4 countdown) | +| mp_show_hintmessages | 1 | 0 | 1 | Send hint messages (Hint_*) to clients.
`0` disabled (non-forced hints are suppressed server-side; forced hints, e.g. ReAPI `rg_hint_message` with override, still pass)
`1` enabled | | mp_old_bomb_defused_sound | 1 | 0 | 1 | Play "Bomb has been defused" sound instead of "Counter-Terrorists win" when bomb was defused
`0` disabled
`1` enabled | | showtriggers | 0 | 0 | 1 | Debug cvar shows triggers. | | sv_alltalk | 0 | 0 | 5 | When players can hear each other ([further explanation](../../wiki/sv_alltalk)).
`0` dead don't hear alive
`1` no restrictions
`2` teammates hear each other
`3` Same as 2, but spectators hear everybody
`4` alive hear alive, dead hear dead and alive.
`5` alive hear alive teammates, dead hear dead and alive. diff --git a/dist/game.cfg b/dist/game.cfg index fc59a237e..b09b6b064 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -206,6 +206,13 @@ mp_show_scenarioicon "0" // Default value: "0" mp_show_bomb_timer "0" +// Send hint messages (Hint_*) to clients. +// 0 - disabled (non-forced hints suppressed server-side; forced hints still pass) +// 1 - enabled (default behavior) +// +// Default value: "1" +mp_show_hintmessages "1" + // Play "Bomb has been defused" sound instead of "Counter-Terrorists win" when bomb was defused // 0 - disabled (default behavior) // 1 - enabled diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 01e07b92a..b6b6fa8c6 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -128,6 +128,7 @@ cvar_t roundover = { "mp_roundover", "0", FCVAR_SERVER, 0.0f, cvar_t forcerespawn = { "mp_forcerespawn", "0", FCVAR_SERVER, 0.0f, nullptr }; cvar_t show_radioicon = { "mp_show_radioicon", "1", 0, 1.0f, nullptr }; cvar_t show_scenarioicon = { "mp_show_scenarioicon", "0", FCVAR_SERVER, 0.0f, nullptr }; +cvar_t show_hintmessages = { "mp_show_hintmessages", "1", 0, 1.0f, nullptr }; cvar_t old_bomb_defused_sound = { "mp_old_bomb_defused_sound", "1", 0, 1.0f, nullptr }; cvar_t item_staytime = { "mp_item_staytime", "300", FCVAR_SERVER, 300.0f, nullptr }; cvar_t legacy_bombtarget_touch = { "mp_legacy_bombtarget_touch", "1", 0, 1.0f, nullptr }; @@ -417,6 +418,7 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&show_scenarioicon); } + CVAR_REGISTER(&show_hintmessages); CVAR_REGISTER(&old_bomb_defused_sound); CVAR_REGISTER(&item_staytime); CVAR_REGISTER(&legacy_bombtarget_touch); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 741e0a571..efd603abf 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -157,6 +157,7 @@ extern cvar_t roundover; extern cvar_t forcerespawn; extern cvar_t show_radioicon; extern cvar_t show_scenarioicon; +extern cvar_t show_hintmessages; extern cvar_t old_bomb_defused_sound; extern cvar_t item_staytime; extern cvar_t legacy_bombtarget_touch; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 25b538ef2..4d6a982aa 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -8111,6 +8111,14 @@ bool EXT_FUNC CBasePlayer::__API_HOOK(HintMessageEx)(const char *pMessage, float if (!bDisplayIfPlayerDead && !IsAlive()) return false; +#ifdef REGAMEDLL_ADD + // Server-side sibling of the client's _ah (auto-help) preference: suppresses + // non-forced hints only. bOverride still bypasses it, exactly as it already + // bypasses m_bShowHints, so ReAPI callers keep their existing escape hatch. + if (!bOverride && show_hintmessages.value == 0.0f) + return true; +#endif + if (bOverride || m_bShowHints) return m_hintMessageQueue.AddMessage(pMessage, duration, true, nullptr);