Basic Scoreboard Creation
This tutorial will explain the basics of creating a custom scoreboard in Garry's Mod.
I will only show how to start it. Customize it to your liking based off of what you learn here. You will require some knowledge of GMod Lua and Client/Server side differences.
Creating a scoreboard is simpler than one would think.
To start, create a client Lua file to overwrite the default scoreboard. Then you will want to create the hooks to do so.
You should only need 2 hooks for the scoreboard:
- GM:ScoreboardHide ScoreboardShow and ScoreboardHide will Show and Hide the scoreboard, respectively.
We'll use an template, that Niandra and others use, to show the information on the scoreboard, you are expected to know how to set up the information on this page.
The code is self explanatory, it sets up the basic functions, and it calls the Hide & Show functions, the comments also show how to make a scoreboard, like using the DListView for creating the rows etc, and a DPanel for the base.
If you use the DListView, and want to paint it, there are multiple ways. For example, I used this for the headers & rows: