Author Topic: Colored ranks  (Read 3451 times)

0 Members and 1 Guest are viewing this topic.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Colored ranks
« on: July 10, 2014, 05:45:26 PM »
I was wondering how I would go about giving different groups colored names in the scoreboard and chat? (btw this is deathrun gamemode) I would look for a function in gmod, but the gmod wiki is a bit... weird. I know there is a Player.SetWalkSpeed function, but I can't find it anywhere in the list of functions on the wiki.

Any and all help appreciated!
« Last Edit: July 10, 2014, 06:54:45 PM by roastchicken »
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Colored ranks
« Reply #1 on: July 10, 2014, 06:11:08 PM »
The documentation for TTT is listed on ttt.badking.net.

For colored playernames, you'd specifically go to: http://ttt.badking.net/guides/hooks and take a look at TTTScoreboardColorForPlayer.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Colored ranks
« Reply #2 on: July 10, 2014, 06:54:14 PM »
Okay, I guess I wasn't clear. I was just mentioning TTT, idk why. I need to know how to do colored ranks in other gamemodes.

Right now I'm still wondering why I even mentioned TTT... I'm stupid sometimes.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Colored ranks
« Reply #3 on: July 10, 2014, 07:28:45 PM »
Oh, sorry for the misunderstanding.

Even though I'm not as good when it comes to VGUI, I'll try to help out anyways.
For adding your own columns for score, ranks etc., I believe you would look into DLabel. Take a look at cl_scoreboard.lua.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Colored ranks
« Reply #4 on: July 11, 2014, 05:30:06 PM »
Command: team.Setup(ID,Name,Color(R,G,B,A))
Example: team.SetUp(1,'Red',Color(255,0,0,255))

Basically, that would make the team color red. Now for the scoreboard, you would just set the color in from team.GetColor(TEAM_ID)


May I ask what deathmatch gamemode, the only deathmatch gamemode on garry's mod that I know of, is my gamemode?
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.