Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS2 Flashing HUD Fix

This is a Counter-Strike Sharp plugin that fixes flashing/pulsing HUD issues commonly seen with surf timer plugins and other HUD message systems in Counter-Strike 2.

How It Works

The plugin is based on the implementation from the CS2Fixes MetaMod plugin and mimics its HUD flashing fix functionality.

The Problem

In CS2, HUD messages (like surf timer displays) that use the show_survival_respawn_status game event can flash or pulse unintentionally. This occurs because the game's HUD rendering behavior changes based on the game state.

The Solution

The plugin manipulates the m_bGameRestart (GameRestart) flag in the game rules to prevent HUD flashing:

  1. Per-Tick Fix: The plugin uses the OnTick listener to set the GameRestart flag every single game tick
  2. Smart Flag Management:
    • Sets GameRestart = true when it's safe (when RestartRoundTime == 0.0)
    • Sets GameRestart = false near round restarts to prevent false "game restarting" UI
  3. Round End Handling: Explicitly sets GameRestart = false at round end to prevent UI issues

Important Notes

⚠️ This fix BREAKS warmup functionality - The plugin automatically ends warmup periods because the workaround conflicts with warmup. You must choose between having warmup or having stable HUD messages.

Installation

  1. Install CounterStrikeSharp on your CS2 server
  2. Compile this plugin or download the compiled DLL
  3. Place FlashingHudFix.dll in game/csgo/addons/counterstrikesharp/plugins/FlashingHudFix/
  4. Load the plugin:
    • Hot reload (no restart needed): Run css_plugins load FlashingHudFix in server console/RCON
    • OR restart your server to auto-load all plugins

The fix is automatically enabled when the plugin loads - no configuration required!

Building from Source

dotnet build

The compiled DLL will be in bin/Debug/net8.0/ or bin/Release/net8.0/

Optional Server Configuration

The plugin works automatically without any configuration. However, you may want to disable warmup on your server:

mp_warmup_online_enabled 0
mp_do_warmup_period 0

Technical Details

Implementation Approach

This plugin uses a different approach than the original CS2Fixes MetaMod implementation:

  • CS2Fixes (MetaMod): Uses a 0.5s repeating timer to set the GameRestart flag
  • This Plugin (CounterStrikeSharp): Uses the OnTick listener to set the flag every game tick

The per-tick approach was necessary because CounterStrikeSharp's property setters required more frequent updates to prevent HUD flashing.

Original CS2Fixes Implementation

The CS2Fixes MetaMod implementation can be found in:

Known Limitations

  1. Breaks Warmup: As mentioned, this workaround is incompatible with warmup periods
  2. Performance: The fix runs every game tick to maintain the GameRestart flag state
  3. Game State Dependency: Requires access to CCSGameRules entity

Compatibility

  • CS2: Compatible with current CS2 builds
  • CounterStrikeSharp: Requires CounterStrikeSharp API
  • Other Plugins: Should be compatible with most plugins, especially surf timers

License

This plugin is provided as-is. You may use and modify it freely, but no warranty is provided.

Credits

Support

If you encounter issues, please check:

  1. You have CounterStrikeSharp installed correctly
  2. The plugin is loaded (check console for "Plugin loaded successfully!")
  3. Warmup is disabled on your server
  4. Your surf timer or HUD plugin is functioning correctly

About

Fixes flashing/pulsing HUD issues commonly seen with surf timer plugins and other HUD message systems in Counter-Strike 2.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages