Hack Forums
[Lua] TTT Scoreboard Ranks - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5)
+---- Thread: [Lua] TTT Scoreboard Ranks (/showthread.php?tid=3223233)



TTT Scoreboard Ranks - -Infamous - Jan 31, 2013



1. Open up sb_row.lua (gamemode/vgui/sb_row.lua)

Add:
Code
self.cols[5] = vgui.Create("DLabel", self)
self.cols[5]:SetText("Rank")

After:
Code
if KARMA.IsEnabled() then
      self.cols[4] = vgui.Create("DLabel", self)
      self.cols[4]:SetText(GetTranslation("sb_karma"))
   end

--------------------------------------------------------------------

Add:
Code
if ply:IsUserGroup("owner") then
self.cols[5]:SetText("Owner")
self.cols[5]:SetTextColor(Color(0,178,238,255))
end

To add more ranks remove "end" from the code and add:

Code
else if ply:IsUserGroup("admin") then
self.cols[5]:SetText("Admin")
self.cols[5]:SetTextColor(Color(238,0,0,255))

Remember to type "end" when your finished adding the ranks.

After:
Code
if self.cols[4] then
      self.cols[4]:SetText(math.Round(ply:GetBaseKarma()))
   end

-------------------------------------------------------------------

1. Open up sb_row.lua (gamemode/vgui/sb_row.lua)

Add:
Code
self.cols[5] = vgui.Create( "DLabel", self )
self.cols[5]:SetText("Rank")

After:
Code
if KARMA.IsEnabled() then
      self.cols[4] = vgui.Create("DLabel", self)
      self.cols[4]:SetText(GetTranslation("sb_karma"))
   end

------------------------------------------------------------------

If your having a bit of trouble setting it up, I have added MY FILES for you to work off.

------------------------------------------------------------------

You can send me a private message if you have a request for a LUA tutorial I can do.
Enjoy 👍



* - Rick Ross™ - Feb 2, 2013

Nice blur out, "[CBC] Boss." Lol, anyway, nice tutorial.