• How to make a custom scoreboard
    8 replies, posted
I can't find anywhere how to make a custom scoreboard, but I have seen it done on my servers with custom gamemodes. I also considered making a vgui Dframe with a DListView that displayed the people on the sever and their scores. But I couldn't figure out how to only display that dialog when they are holding down the f key for example. I know it has something to do with + and - but I can't figure out how to bind the functions to the commands correctly.
If you want a derma menu to open and close on the press and release of a key you should use something like this: [lua] -- bind f dermatest concommand.Add( "+dermatest", Derma_test ) -- you put the name of the bind then you have it call what ever function makes the derma concommand.Add( "-dermatest", function() Derma_test:Close() end ) -- this is when you release said bind, it closes the derma you set it to close. [/lua]
but like this people would have to manually bind a key to +dermatest right?
Yes they would, An easier way would be for them to use Q, and use +menu and -menu.
or you could allways over write the default scoreboard.... and have it on tab...
Hmm. No matter what I do I can't seem to get it to recognize the + and - it just says Unknown Command error. When I try using +/-menu it just doesn't work. I am putting this at the end of my cl_init.lua Is that okay? [editline]03:54PM[/editline] how would i overwrite the default scoreboard? I have found references to things like: [url]http://wiki.garrysmod.com/?title=Gamemode.HUDDrawScoreBoard[/url] and [url]http://wiki.garrysmod.com/?title=Gamemode.ScoreboardShow[/url] But that doesn't help
whoops, accident, didn't see the date!
Make your own panel object with a table and vgui.Register("yourscoreboard", PANEL). Then open it with [lua] function GM:ScoreboardShow() if ( !IsValid(self.scoreboard) ) then self.scoreboard = vgui.Create("yourscoreboard") end self.scoreboard:Show() end function GM:ScoreboardHide() if ( IsValid(self.scoreboard) ) then self.scoreboard:Hide() end end [/lua]
Thanks Chessnut, I had the same question
Sorry, you need to Log In to post a reply to this thread.