Welcome, Guest. Please login or register.
Did you miss your activation email?
November 25, 2024, 11:53:38 AM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Custom scoreboard colours not working?
Pages: [1]
Author Topic: Custom scoreboard colours not working?  (Read 3240 times)
RandomGamer342
Poster

Posts: 10


« on: April 06, 2011, 04:00:57 PM »

   if SERVER then
      -- when the server loads this script, tell it to send it to clients
      AddCSLuaFile("scoreboardcolors.lua")
    else
      -- when a client runs it, add the hook
      function MySBColors(ply)
        if ply:IsUserGroup("coder") then
            return Color(0, 255, 255) -- Cyan
        elseif ply:IsUserGroup("Donator") then
            return Color(55, 255, 0) -- Light green
        elseif ply:IsUserGroup("Donatorplus") then
            return Color(50, 140, 0) -- Green
        elseif ply:IsUserGroup("Tempmod")
            return Color(255, 255, 0) -- Yellow
        elseif ply:IsUserGroup("Moderator") then
            return Color(235, 90, 0) -- Orange
        elseif ply:IsUserGroup("admin") or ply:IsUserGroup("superadmin") then
            return Color(120, 0, 255) -- Purple
        elseif ply:IsUserGroup("owner") then
            return Color(0, 0, 255) -- Blue
        end
      end
      hook.Add("TTTScoreboardColorForPlayer", "MySBColors", MySBColors)


What's the problem with the above code?

It's put into lua\autorun if youre wondering, and it gets downloaded
dalix
Poster

Posts: 5


« Reply #1 on: April 06, 2011, 04:50:56 PM »

is there an ttt admin mod? didnt know
Cush
Poster

Posts: 79


« Reply #2 on: April 06, 2011, 05:41:04 PM »

You forgot the 'then' after ("Tempmod")
RandomGamer342
Poster

Posts: 10


« Reply #3 on: April 06, 2011, 06:24:48 PM »

Noticed that now, pretty big fail on my part. Used my "old" non-working version of the code that actually had the then(and looked a lot nicer) but fixed the other thing i found when editing badking's own code.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Custom scoreboard colours not working? « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.009 seconds with 17 queries.