General > Developers Corner

ULX scoreboard and text color help TTT server

<< < (4/7) > >>

DJ Mikey:
I got everything working now.  Boy does it look neat!  Thank you all for the help!

Decicus:
I completely forgot I about this, sorry man. I had other things on my mind at the time. Although, I'm happy that you got it fixed! What did you do to fix it? (Just out of curiousity)

iSnipeu:
You do not need to change default TTT files to get it working, just use a hook.


--- Code: ---hook.Add("TTTScoreboardColorForPlayer", "RankColours", function( ply )
if ply:SteamID() == "STEAM_0:0:0000000" then
return Color( 153, 255, 255 )
end
end)
--- End code ---

Decicus:
I don't see how that would work, care to explain?

iSnipeu:

--- Quote from: Decicus on August 31, 2013, 06:53:30 AM ---I don't see how that would work, care to explain?

--- End quote ---

TTT has hooks you can use so you don't have to edit the gamemode for general things.


--- Quote from: http://ttt.badking.net/guides/hooks ---TTTScoreboardColorForPlayer (ply)
Client
Called to determine what colour a player's name should be on the scoreboard. Hence, it must return a Color object, or return nil (or nothing at all). The "ply" parameter contains a player object, so you can for example check the player's SteamID and give certain people a special colour. Note that TTT also uses this hook for the default colours, so you should return nil for players that you do not want to do anything special with.

--- End quote ---
http://ttt.badking.net/guides/hooks

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version