Add mp_show_hintmessages cvar to allow blocking hint messages server-side#1166
Open
belomaxorka wants to merge 1 commit into
Open
Add mp_show_hintmessages cvar to allow blocking hint messages server-side#1166belomaxorka wants to merge 1 commit into
mp_show_hintmessages cvar to allow blocking hint messages server-side#1166belomaxorka wants to merge 1 commit into
Conversation
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>
mp_show_hintmessages cvar to allow blocking hint messages server-side
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new cvar
mp_show_hintmessages(default1) that allows servers to disable sending hint messages (#Hint_*) to clients.Why
Server operators often want to get rid of the tutorial-style hint popups (e.g.
#Hint_you_have_the_bomb,#Hint_spotted_an_enemy, zone hints). Currently this requires a plugin that hooksRG_CBasePlayer_HintMessageExand supersedes it. Since every hint goes through a single function, this is trivial to support natively.How it works
All hint messages are routed through
CBasePlayer::HintMessageEx()(both directly and via theHintMessage()wrapper) before being queued intom_hintMessageQueue. Whenmp_show_hintmessagesis0,HintMessageEx()returnsfalseimmediately, so nothing is queued and nothing is sent to the client. The check is underREGAMEDLL_ADD; default value1keeps vanilla behavior.Edge cases
#Got_bomb) are not affected - they are not hints and bypass the hint queue by design.RG_CBasePlayer_HintMessageExstill fires as before; the cvar check is inside the hooked function body, so plugins keep working.m_bShowHints) is untouched; the cvar acts as a server-wide override on top of it.Tested
Built Win32 Release (MSVC) and verified on a listen/dedicated ReHLDS server: with the cvar at
1the bomb pickup hint is shown as usual; aftermp_show_hintmessages 0(changeable at runtime) no hints are delivered, while center messages remain intact.