ULX

Author Topic: Custom Chat Colors  (Read 23169 times)

0 Members and 1 Guest are viewing this topic.

Offline Adult

  • Newbie
  • *
  • Posts: 15
  • Karma: 1
Custom Chat Colors
« 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!

Offline Nightmare2244

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: Custom Chat Colors
« Reply #1 on: February 09, 2013, 06:35:53 PM »
Every time I type !chatcolor 255. It never sets it.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom Chat Colors
« Reply #2 on: February 09, 2013, 07:24:55 PM »
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.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Custom Chat Colors
« Reply #3 on: February 09, 2013, 08:03:58 PM »
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.

« Last Edit: February 09, 2013, 08:05:46 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom Chat Colors
« Reply #4 on: February 10, 2013, 06:27:04 AM »
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)
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Deathtitan77

  • Jr. Member
  • **
  • Posts: 63
  • Karma: 6
Re: Custom Chat Colors
« Reply #5 on: February 10, 2013, 08:34:13 AM »
The colors don't work for TTT. It says your chat color has been set to [#,#,#] but it doesn't work.

Offline Nightmare2244

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: Custom Chat Colors
« Reply #6 on: February 10, 2013, 03:29:37 PM »
yes I do that. I type !chatcolor nightmare 255 255 255. And type hi after that command and it never works

Offline Adult

  • Newbie
  • *
  • Posts: 15
  • Karma: 1
Re: Custom Chat Colors
« Reply #7 on: March 01, 2013, 01:09:10 PM »
<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.
« Last Edit: March 01, 2013, 03:59:28 PM by JamminR »

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
Re: Custom Chat Colors
« Reply #8 on: March 20, 2013, 12:44:15 AM »
Funny, I just had a similar idea! I'll have to check this out soon.
My TTT server. Join the fun!

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom Chat Colors
« Reply #9 on: April 11, 2013, 09:23:59 PM »
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
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Deathtitan77

  • Jr. Member
  • **
  • Posts: 63
  • Karma: 6
Re: Custom Chat Colors
« Reply #10 on: April 12, 2013, 09:06:18 AM »
[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

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom Chat Colors
« Reply #11 on: April 12, 2013, 03:42:08 PM »
[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?
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom Chat Colors
« Reply #12 on: April 12, 2013, 04:12:20 PM »
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
« Last Edit: April 12, 2013, 04:14:01 PM by chaos13125 »
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Deathtitan77

  • Jr. Member
  • **
  • Posts: 63
  • Karma: 6
Re: Custom Chat Colors
« Reply #13 on: April 13, 2013, 04:48:04 AM »
Server @ lua error.

Also, what does your second version fix exactly?

Where do I edit the chat tags in your second version?
« Last Edit: April 13, 2013, 05:11:10 AM by Deathtitan77 »

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom Chat Colors
« Reply #14 on: April 13, 2013, 04:38:56 PM »
You gotta look at it yourself, I'm on vacation and won't be able to fix it
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.