TTT Custom Ranks

I was wondering if there is a way to make custom ranks using peoples steam ID so that you wouldn’t have to go in and code their group in to all of the pointshop stuff on ttt. I know how to make ranks using groups but not using just like an IP or steam id. Any help is greatly appreciated :slight_smile:

Replace anything in the code about IsUserGroup or whatever, with ply:SteamID() == “SteamIDHere”

Alright that worked, but there’s one problem. The rank with steam id works and the rank with group works but if you have the rank with group (like admin) it puts that one up on the scoreboard instead. Do you know how to make it so that it will say just the steam id one and let them be in a group?

you do the steamid check after the group check.

Or… like have the steam id rank be in the middle of the scoreboard and the group rank to the right how it is in this picture?

http://puu.sh/66DR4.jpg

[editline]2nd January 2014[/editline]

So i add these two together somehow?

if ply:IsUserGroup(“Owner”) then -> elseif ply:IsUserGroup(“Owner”) then

I guess, you’re not really giving us much to work with here.

This is the section of the code for my sb_row.lua, I’m kinda confused on how to add an elseif if there is already one there for it. I’m very new to lua lol

[lua]function PANEL:UpdatePlayerData()
if not IsValid(self.Player) then return end

local ply = self.Player
self.cols[1]:SetText(ply:Ping())
self.cols[2]:SetText(ply:Deaths())
self.cols[3]:SetText(ply:Frags())

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

self.nick:SetText(ply:Nick())
self.nick:SizeToContents()
self.nick:SetTextColor(ColorForPlayer(ply))

if ply:IsUserGroup(“Owner”) then
self.cols[5]:SetText(“Owner”)
self.cols[5]:SetTextColor(namecolor.test)

elseif ply:IsUserGroup(“superadmin”) then
self.cols[5]:SetText(“SuperAdmin”)
self.cols[5]:SetTextColor(Color(247, 12, 0, 255))

elseif ply:IsUserGroup(“admin”) then
self.cols[5]:SetText(“Admin”)
self.cols[5]:SetTextColor(Color(252, 31, 186, 255))

elseif ply:IsUserGroup(“operator”) then
self.cols[5]:SetText(“Mod”)
self.cols[5]:SetTextColor(Color(243, 255, 5, 255) )

elseif ply:IsUserGroup(“Regular”) then
self.cols[5]:SetText(“Regular”)
self.cols[5]:SetTextColor(Color(0, 254, 165, 255))

elseif ply:IsUserGroup(“doperator”) then
self.cols[5]:SetText("Mod")
self.cols[5]:SetTextColor(Color(243, 255, 5, 255))

elseif ply:IsUserGroup(“dadmin”) then
self.cols[5]:SetText("Admin")
self.cols[5]:SetTextColor(Color(252, 31, 186, 255))

elseif ply:IsUserGroup(“dsuperadmin”) then
self.cols[5]:SetText("SuperAdmin")
self.cols[5]:SetTextColor(Color(247, 12, 0, 255))

elseif ply:IsUserGroup(“Super Admin”) then
self.cols[5]:SetText(“SuperAdmin”)
self.cols[5]:SetTextColor(Color(247, 12, 0, 255))

elseif ply:IsUserGroup(“Donator”) then
self.cols[5]:SetText("Donator")
self.cols[5]:SetTextColor(Color(15, 253, 3, 255))

elseif ply:IsUserGroup(“newbie”) then
self.cols[5]:SetText(“Newbie”)
self.cols[5]:SetTextColor(Color(147, 153, 152, 255))

elseif ply:IsUserGroup(“respected”) then
self.cols[5]:SetText(“Respected”)
self.cols[5]:SetTextColor(Color(189, 248, 52, 255))

elseif ply:SteamID(“STEAM_0:1:68903776”) then
self.cols[5]:SetText(“TestTestTest”)
self.cols[5]:SetTextColor(Color(189, 248, 52, 255))
– elseif ply:IsUserGroup(“admin”) then
– self.cols[5]:SetText(“Admin”)
– self.cols[5]:SetTextColor(Color(255, 215, 0, 255))
– Delete the – and change the settings to your liking. DO NOT DELETE THE ‘end’
end[/lua]

Okay, if an if statement is true, the elseifs won’t be called, therefore the further up the chain the higher the priority it has over other if statements. So if you want your SteamID ranks to prioritize over usergroup ranks just move them to the top:

[lua]if ply:SteamID(“STEAM_0:1:68903776”) then
self.cols[5]:SetText(“TestTestTest”)
self.cols[5]:SetTextColor(Color(189, 248, 52, 255))
elseif ply:IsUserGroup(“Owner”) then

…[/lua]

awesome!! thanks sooo much. trying that out now

[editline]2nd January 2014[/editline]

alright I did that and now everyone regardless of that steam id is ranked “TestTestTest”
so how do i make it so that only that steam id has that?

Can you check steam ids like that?
I thought you had to do
[LUA] if ( ply:SteamID() == “steamid” ) then [/LUA]

Player:SteamID() only returns the players SteamID, requires no arguments. So like rejax showed above is how you would do it.