Skip to content

A simple CS2 plugin that shows the player's speed in the middle of their screen using point_worldtext.

License

Notifications You must be signed in to change notification settings

M-archand/CenterSpeed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.


Center Speed

A CS2 plugin that shows the player's speed using point_worldtext.

image


Download

Demo (YouTube)

Dependencies

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.

Configuration

  • 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
}

Commands

  • !cs - Toggles centerspeed
  • !cs menu - Opens the settings menu (if CS2MenuManager is installed)
  • !cs is customizable in the config

Roadmap

  • Translations
  • Non OnTick based updates

License

Distributed under the GPL-3.0 License. See LICENSE.md for more information.

GitHub Downloads

(back to top)

About

A simple CS2 plugin that shows the player's speed in the middle of their screen using point_worldtext.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Languages