General > Developers Corner
ULX scoreboard and text color help TTT server
Decicus:
Oh yeah, forgot about that hook.
Although, if he wanted that other column with the "Rank" or whatever, one would still need to modify the files.
DJ Mikey:
i actually did not need to do much. It wasnt working at first and giving me console errors, i navigated to the lines that were generating the lua errors and simply made some minor edits. (had some extra end's)
As far as making the rank column not over lap, i just got rid of the Super Admin text and edited it to read Owner. Now all group names fit and i dont need to meddle around to much with the script. All i need to do now is add an extra group to get rid of the "rank" group for normal users. Should be easy enough now that i understand how the script works in those lines.
Decicus:
That is actually an easy edit, in where the ranks are, under the ones for "admin" and "superadmin". Just add this:
--- Code: --- elseif ply:IsUserGroup("user") then
self.cols[5]:SetText("Player")
self.cols[5]:SetTextColor(Color(255, 255, 255, 255))
--- End code ---
Edit as you would like it to be.
DJ Mikey:
i thought for color white it was 0, 0, 0, 255
i have already added the user group to read Guest, i added another line for group "member" players gain member status upon registering to the forums!
actually heres a question
Here is what i got now
--- Code: ---local namecolor = {
default = COLOR_WHITE,
admin = Color(220, 180, 0, 255),
dev = Color(0, 100, 255, 255),
test = Color(220, 0, 0, 255),
member = Color(50, 255, 0, 255)
};
function GM:TTTScoreboardColorForPlayer(ply)
if not IsValid(ply) then return namecolor.default end
--ADD NAMECOLOURS HERE--
if ply:SteamID() == "STEAM_0:0:xxxxxxxxx" then
return namecolor.dev
elseif ply:SteamID() == "STEAM_0:0:xxxxxxxx" then
return namecolor.dev
elseif ply:SteamID() == "STEAM_0:1:xxxxxxxxxx" then
return namecolor.dev
elseif ply:SteamID() == "STEAM_0:1:xxxxxxxxxx" then
return namecolor.dev
elseif ply:SteamID() == "STEAM_0:1:xxxxxxxxxx" then
return namecolor.dev
elseif ply:SteamID() == "STEAM_0:1:xxxxxxxxxxx" then
return namecolor.dev
elseif ply:SteamID() == "STEAM_0:1:xxxxxxxxxx" then
return namecolor.dev
elseif ply:IsAdmin() and GetGlobalBool("ttt_highlight_admins", true) then
return namecolor.admin
elseif ply:IsUserGroup("superadmin") then
return namecolor.test
elseif ply:IsUserGroup("member") then
return namecolor.member
end
return namecolor.default
end
--- End code ---
Instead of using each persons steam id for VIP specific colors... could i just do this instead
--- Code: ---local namecolor = {
default = COLOR_WHITE,
admin = Color(220, 180, 0, 255),
dev = Color(0, 100, 255, 255),
test = Color(220, 0, 0, 255),
member = Color(50, 255, 0, 255)
};
function GM:TTTScoreboardColorForPlayer(ply)
if not IsValid(ply) then return namecolor.default end
--ADD NAMECOLOURS HERE--
if ply:IsUserGroup("vip") then
return namecolor.dev
elseif ply:IsAdmin() and GetGlobalBool("ttt_highlight_admins", true) then
return namecolor.admin
elseif ply:IsUserGroup("superadmin") then
return namecolor.test
elseif ply:IsUserGroup("member") then
return namecolor.member
end
return namecolor.default
end
--- End code ---
It would be much easier and i wouldnt need to edit the lua for new VIPs
JamminR:
0 = absense of color.
255 = full range of color
000 = black
255255255 = white
:)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version