Ulysses
Ulysses Stuff => Releases => Topic started by: Adult on December 08, 2012, 07:31:15 AM
-
Just something I made when I was bored. Allows you to have custom chat colors.
ulx chatcolor # # # - sets your chat color.
ulx setcolor <ply> # # # - sets target's chat color, admin only
ulx removecolor <ply> - removes target's chat color, admin only
Enjoy!
-
Every time I type !chatcolor 255. It never sets it.
-
Every time I type !chatcolor 255. It never sets it.
I don't think you can do that. It looks like you can only do it through console or xgui maybe. Not sure, didn't download it or anything.
-
I don't think you can do that.
Adult has the chat command fine. (at least, from my QUICK check.
The command requires 3 numbers. # # #, just like the instructions in the original post say.
Nightmare would have to have !chatcolor 255 255 255 for it to work.
It should have come back with an error telling him he was missing parameters.
Adult, your addons.txt isn't named right.
It has two .txt on it addons.txt.txt
May want to fix that.
-
Adult has the chat command fine. (at least, from my QUICK check.
The command requires 3 numbers. # # #, just like the instructions in the original post say.
Nightmare would have to have !chatcolor 255 255 255 for it to work.
It should have come back with an error telling him he was missing parameters.
I see that now
local setcolor = ulx.command( "Chat", "ulx setcolor", ulx.setcolor, "!setcolor" )
and also
local removecolor = ulx.command( "Chat", "ulx removecolor", ulx.removecolor, "!removecolor" )
pretty cool man, when I get back from vacation this weekend I'll check it out and see if I'm getting the same problem as Nightmare. From what I'm assuming Jammin is most likely correct, and you have to do !setcolour # # #, because leaving the parameters blank causing nil values I believe.
My suggest for this addon is this. If someone for some strange reason forgets to fill the rest of it aka just doing !setcolour 100, then it should send some sort of AddChat to local player saying they changed it... actually wait before I even say that... When someone does !setcolour does it change everyone's chat colour, or just person who typed it? (reminder I didn't really even check the code that much, just briefly looked at it)
-
The colors don't work for TTT. It says your chat color has been set to [#,#,#] but it doesn't work.
-
yes I do that. I type !chatcolor nightmare 255 255 255. And type hi after that command and it never works
-
<Censor> I didn't even notice this, haven't checked here in a while. I'll start looking into it now. Sorry :L
EDIT by JamminR - Keep it clean here please Adult. We like to keep a family oriented environment for all ages.
-
Funny, I just had a similar idea! I'll have to check this out soon.
-
This addon was not working correctly, and I was asked to fix it so in doing so I have fixed it and made the following changes to it:
Changed This:
ulx chatcolor # # # - sets your chat color.
ulx setcolor <ply> # # # - sets target's chat color, admin only
ulx removecolor <ply> - removes target's chat color, admin only
to this
ulx chatcolor # # # - sets your chat color.
ulx setchatcolor <ply> # # # - sets target's chat color, admin only
ulx removechatcolor <ply> - removes target's chat color, admin only
-
[ERROR] addons/ulx chatcolors/lua/ulx/modules/sh/chatcolors.lua:68: attempt to call method 'SteamID' (a nil value)
1. fn - addons/ulx chatcolors/lua/ulx/modules/sh/chatcolors.lua:68
2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
@ chaos13125's version
-
[ERROR] addons/ulx chatcolors/lua/ulx/modules/sh/chatcolors.lua:68: attempt to call method 'SteamID' (a nil value)
1. fn - addons/ulx chatcolors/lua/ulx/modules/sh/chatcolors.lua:68
2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
@ chaos13125's version
Are you running this on a Server or just your single player client?
-
This one has my Chat Tags addon in it too, because someone asked or w/e. Thing is that this WILL NOT KEEP YOUR CHAT COLORS, so when you relog, or switch maps it won't stay. I don't know why, but it's not my addon, so I'm not willing to really fix it
you will have to delete my current chat tags addon, and the current color chat addon
-
Server @ lua error.
Also, what does your second version fix exactly?
Where do I edit the chat tags in your second version?
-
You gotta look at it yourself, I'm on vacation and won't be able to fix it
-
Does this work or?
-
Someone should really remake this so it works!
-
I have something similar in some chat tags I made for my gamemode, if anyone wants it I will post the code here.
-
I have something similar in some chat tags I made for my gamemode, if anyone wants it I will post the code here.
You mean chat tags, that you can color?
-
You mean chat tags, that you can color?
No a thing where you can set the color of your text by doing `color` text, the chat tags part wasn't relevent
-
No a thing where you can set the color of your text by doing `color` text, the chat tags part wasn't relevent
Oh, so if I wanted to change me color to yellow, i would just type color, something like that? If it is like that, It would be great if you would share it with us.
-
local groups = {
{ "vip", Color( 0, 200, 0 ), "VIP" },
{ "betatester", Color( 180, 180, 180 ), "Beta Tester" },
{ "vip+", Color( 0, 255, 0 ), "VIP+" },
{ "owner", Color( 255, 0, 0 ), "Owner" },
{ "creator", Color( 200, 0, 0 ), "Creator" },
{ "coowner", Color( 255, 0, 0 ), "Co-Owner" },
{ "superadmin", Color( 255, 0, 0 ), "Superadmin" },
{ "admin", Color( 220, 180, 0 ), "Admin" }
}
local ccolors = {
{ "red", Color( 255, 0, 0 ) },
{ "blue", Color( 0, 0, 255 ) },
{ "yellow", Color( 255, 255, 0 ) },
{ "black", Color( 0, 0, 0 ) },
{ "white", Color( 255, 255, 255 ) },
{ "green", Color( 0, 255, 0 ) },
{ "orange", Color( 255, 120, 0 ) },
{ "pink", Color( 255, 0, 255 ) },
{ "purple", Color( 270, 0, 255 ) }
}
local ti = table.insert
local IsValid = IsValid
local Color = Color
local unpack = unpack
local white = color_white
function GM:OnPlayerChat( ply, text, teamonly, dead )
local tab = {}
if IsValid( ply ) then
if dead then
ti( tab, Color( 255, 30, 40 ) )
ti( tab, "*DEAD* " )
end
if teamonly then
ti( tab, Color( 30, 160, 40 ) )
ti( tab, "(TEAM) " )
end
local strcol = white
local customfound = false
for k, v in next, ccolors do
if string.StartWith( text, "`" .. v[ 1 ] .. "`" ) then
local pos = string.find( text, "`" .. v[ 1 ] .. "`" ) + v[ 1 ]:len()
text = string.sub( text, pos + 3 )
strcol = v[ 2 ]
customfound = true
end
end
if customfound == false and string.StartWith( text, "`" ) then
local exp = string.Explode( "`", text:sub( 2 ) )
local str = exp[ 1 ]
local str2 = string.Explode( " ", str )
if #str2 == 3 then
str2[ 4 ] = "255"
end
local col = string.ToColor( table.concat( str2, " " ) )
strcol = col or color_white
local pos = string.find( string.sub( text, 2 ), "`" )
text = string.sub( text, pos + 3 )
end
if ply:GetNWString( "usergroup" ) == "user" then
ti( tab, ply )
ti( tab, white )
ti( tab, ": " )
ti( tab, strcol )
ti( tab, text )
else
for k, v in next, groups do
if ply:GetNWString( "usergroup" ) == v[ 1 ] then
ti( tab, v[ 2 ] )
ti( tab, "[" .. v[ 3 ] .. "] " )
ti( tab, ply )
ti( tab, white )
ti( tab, ": " )
ti( tab, strcol )
ti( tab, text )
end
end
end
chat.AddText( unpack( tab ) )
return true
end
end
-
So basically the player types for example "color red" and it changes their chat color to red?
-
So basically the player types for example "color red" and it changes their chat color to red?
`red` text -> text
`255 0 0` text -> text
-
For my server I use hat chat, and it has a built in tag system, do you think the script would work if I removed the local groups area in the script?
-
For my server I use hat chat, and it has a built in tag system, do you think the script would work if I removed the local groups area in the script?
Probably not but you can try it.
-
Chat Color resets after a map change. Is there a way to make it a player's permanent color until they or someone else changes it?