• Print

Author Topic: ULX scoreboard and text color help TTT server  (Read 49697 times)

0 Members and 1 Guest are viewing this topic.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: ULX scoreboard and text color help TTT server
« Reply #30 on: September 01, 2013, 10:23:08 am »
Yes, remember that Lua is case sensitive, so any capital letters should be checked if they're supposed to be capital.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline DJ Mikey

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
Re: ULX scoreboard and text color help TTT server
« Reply #31 on: September 01, 2013, 10:40:14 am »
well, with that last fix im all wrapped up with scoreboard groups and scoreboard colors.  I appreciate all the help from everyone who posted here.

Offline MiniCale

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: ULX scoreboard and text color help TTT server
« Reply #32 on: March 31, 2016, 03:27:55 pm »
When I have tried to get this to work for my server it doesnt work for the other groups only myself as superadmin,

Any help is appreciated

Code: Lua
  1. function GM:TTTScoreboardColorForPlayer(ply)
  2.    if not IsValid(ply) then return namecolor.default end
  3.  
  4.    if ply:SteamID() == "STEAM_0:0:1963640" then
  5.       return namecolor.dev
  6. elseif ply:IsUserGroup("superadmin") then
  7.                 return namecolor.superadmin
  8. elseif ply:IsUserGroup("Moderator") then
  9.                 return namecolor.moderator
  10. elseif ply:IsUserGroup("Admin") then
  11.                 return namecolor.admin
  12.    end
  13.    return namecolor.default
  14. end
  15.  
  16. local function ColorForPlayer(ply)
  17.    if IsValid(ply) then
  18.       local c = hook.Call("TTTScoreboardColorForPlayer", GAMEMODE, ply)
  19.  
  20.       -- verify that we got a proper color
  21.       if c and type(c) == "table" and c.r and c.b and c.g and c.a then
  22.          return c
  23.       else
  24.          ErrorNoHalt("TTTScoreboardColorForPlayer hook returned something that isn't a color!\n")
  25.       end
  26.    end
  27.    return namecolor.default
  28. end

  • Print