Welcome, Guest. Please login or register.
Did you miss your activation email?
September 20, 2024, 04:02:45 AM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Help with colored names
Pages: [1]
Author Topic: Help with colored names  (Read 4677 times)
JoTheShmo
Poster

Posts: 214



« on: February 08, 2011, 01:30:28 AM »

function ColorName( pl )
if pl:SteamID() == "STEAM_0:0:21078630" then -- Alters
return Color(255, 20, 147, 255 )
elseif pl:SteamID() == "STEAM_0:1:13793540" then -- Jo
return Color( 255, 100, 0, 255 )
elseif pl:SteamID() == "STEAM_0:0:9859076" then -- Snake
return Color( 79, 85, 47, 255 )
elseif pl:SteamID() == "STEAM_0:0:6494542" then --Anarchy366
return Color(9, 249, 17)
elseif pl:SteamID() == "STEAM_0:1:23719766" then --Jawn
return Color(9, 249, 17)
elseif pl:SteamID() == "STEAM_0:0:19154465" then --Darkest
return Color(9, 249, 17)
elseif pl:SteamID() == "STEAM_0:1:11601857" then --Roy Campbell
return Color(9, 249, 17)
elseif pl:SteamID() == "STEAM_0:0:62398" then --Little Strawberry
return Color(9, 249, 17)
elseif pl:SteamID() == "STEAM_0:0:5883298" then --Teddy Weddy
return Color(9, 249, 17)
else
return nil
end
end

hook.Add( "TTTScoreboardColorForPlayer ", "ColorPlayersName", ColorName )



Can anyone find anything wrong with this code?
I know for a fact it's being run on the client, but it still doesn't work.


Also a few other things:
] rcon ttt_namechange_kick
autokick is disabled for Jo The Shmo.j2
"ttt_namechange_kick" = "1"
game notify clientcmd_can_execute
] rcon ttt_namechange_bantime
"ttt_namechange_bantime" = "20" ( def. "10" )
game clientcmd_can_execute

As you can see, it clearly says namechange banning is on, but people can change their names without being banned.
« Last Edit: February 08, 2011, 01:32:14 AM by JoTheShmo »
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #1 on: February 08, 2011, 08:25:17 AM »

Missing Alpha in the Color(0,0,0,255) after the first three, might want to sort that


For namechange ban:

Whats your banning method?
« Last Edit: February 08, 2011, 08:27:39 AM by phoenixf129 »

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Cush
Poster

Posts: 79


« Reply #2 on: February 08, 2011, 04:15:27 PM »

For the first one - Just to make it clear you are putting it in your lua/autorun folder on the server?

Having the alpha there doesnt matter unless you want to change it, you can use just the RGB values and it will work fine, also it should look like this;


if SERVER then
  AddCSLuaFile("nameofthisfile.lua")
else

  function ColorName( pl )
if pl:SteamID() == "STEAM_0:0:21078630" then -- Alters
return Color( 255, 20, 147 )
elseif pl:SteamID() == "STEAM_0:1:13793540" then -- Jo
return Color( 255, 100, 0 )
elseif pl:SteamID() == "STEAM_0:0:9859076" then -- Snake
return Color( 79, 85, 47 )
elseif pl:SteamID() == "STEAM_0:0:6494542" then --Anarchy366
return Color(9, 249, 17 )
elseif pl:SteamID() == "STEAM_0:1:23719766" then --Jawn
return Color(9, 249, 17 )
elseif pl:SteamID() == "STEAM_0:0:19154465" then --Darkest
return Color(9, 249, 17 )
elseif pl:SteamID() == "STEAM_0:1:11601857" then --Roy Campbell
return Color(9, 249, 17 )
elseif pl:SteamID() == "STEAM_0:0:62398" then --Little Strawberry
return Color(9, 249, 17 )
elseif pl:SteamID() == "STEAM_0:0:5883298" then --Teddy Weddy
return Color(9, 249, 17 )
else
return nil
end
end

hook.Add( "TTTScoreboardColorForPlayer ", "ColorPlayersName", ColorName )

end


Gotta AddCSLua the file so it gets sent to the client.

« Last Edit: February 08, 2011, 04:37:54 PM by Cush »
JoTheShmo
Poster

Posts: 214



« Reply #3 on: February 08, 2011, 09:25:31 PM »

Gotta AddCSLua the file so it gets sent to the client.




If you read my post, you would know that it is in fact being run on clients.
I added it in a different file, and I had tested it by just drawing a box on the hud.

My banning method is ulx, but I just noticed I put quotes in the name. I'm going to try it without the quotes.

Also I will try it with the alpha added in.
Cush
Poster

Posts: 79


« Reply #4 on: February 08, 2011, 09:33:12 PM »

Well you didnt include it in the code so I wasnt sure if that was the entire file or not.

There isnt anything wrong with the code there, and it doesnt make a difference if you put the alpha in or not so it must be an issue on your end.
JoTheShmo
Poster

Posts: 214



« Reply #5 on: February 08, 2011, 09:55:45 PM »

Changing the "ulx" to ulx didn't help, and neither did adding alpha.
I know it's a problem on all clients too.
JoTheShmo
Poster

Posts: 214



« Reply #6 on: February 08, 2011, 10:08:54 PM »

I just found out the namechange thing does ban you, but doesn't kick.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #7 on: February 08, 2011, 11:07:36 PM »

If you set it to ulx it uses ULib.kickban. If that does not kick properly it's a ulx/ulib problem (perhaps with your specific version/install).
JoTheShmo
Poster

Posts: 214



« Reply #8 on: February 09, 2011, 09:11:19 PM »

Alright, I'll look into that.
And what about the name colors? Did you see anything that could be wrong with that? There aren't any errors.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #9 on: February 09, 2011, 09:45:29 PM »

Yes, remove the space at the end of the hook name. "TTTScoreboardColorForPlayer " != "TTTScoreboardColorForPlayer", so the hook does not get called.
JoTheShmo
Poster

Posts: 214



« Reply #10 on: February 09, 2011, 11:40:40 PM »

Holy shit that was a stupid mistake.
Thanks!
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Help with colored names « 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 18 queries.