Warning
Valve ruined this plugin with the July 28 update by removing CBaseViewModel from the game. So the speed text doesn't stay properly centered anymore. I'll update it if a new approach is found.
To use this plugin, you'll need the following dependencies installed:
- CounterStrikeSharp v330+ (Required): CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2.
- CS2-GameHUD v1.DZ.2 (Required): A shared API used to create the world text.
- Clientprefs (Optional): A shared API that allows you to save the on/off cookie for each player to a database to have persistence between server restarts. Will automatically be used if it is installed, otherwise players will have to enable it again if the server restarts. If using CS2MenuManager, it will also save the other text settings here.
- CS2MenuManager v39+ (Optional): A shared API used to manage the settings menu for the player. If not installed, the menu command won't be available and the player will use the settings you have defined in the config.
- A config file will be generated on first use located in /addons/counterstrikesharp/configs/CenterSpeed Example:
{
"TextSettings": {
"Size": 45,
"Font": "Arial",
"Color": "Salmon", # System.Drawing.Colors: https://i.sstatic.net/lsuz4.png
"Position": 0 # Y position of the text. 0 = middle, negative int like -40 is lower, positive int like 40 is higher
},
"Command": "cs,centerspeed", # The command(s) to enable/disable centerspeed (!cs)
"TickInterval": 4, # How often the hud will update. 64 ticks = 1 second.
"DisableCrosshair": true, # Whether to disable the knife crosshair for the player while centerspeed is enabled
"Use2DSpeed": true, # true = 2D speed = X, Y speed. false = 3D speed = X,Y,Z speed
"MenuType": "WasdMenu", # The CS2MenuManager menu to be used for changing settings.
"Channel": 17, # This is for the CS2-GameHUDAPI, if you don't know what it does then leave it as is
"ConfigVersion": 1
}
- !cs - Toggles centerspeed
- !cs menu - Opens the settings menu (if CS2MenuManager is installed)
- !cs is customizable in the config
- Translations
- Non OnTick based updates
Distributed under the GPL-3.0 License. See LICENSE.md for more information.
