• Print

Author Topic: ULX Staff CHat help?  (Read 10631 times)

0 Members and 1 Guest are viewing this topic.

Offline admiralmirage

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: ULX Staff CHat help?
« Reply #15 on: March 14, 2018, 09:25:31 pm »
There are... No errors at all.
None in console, none when I do it, nothing.

Offline admiralmirage

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: ULX Staff CHat help?
« Reply #16 on: March 14, 2018, 09:28:39 pm »
Well I figured out I missed a part of the script
Code: [Select]
table.insert( strs, default_color )
table.insert( strs, "," )
end
Was missing so I added it.
Now, the colors are extremely ugly, so how do I change that (lmao)

Offline BlueNova

  • Full Member
  • ***
  • Posts: 113
  • Karma: 13
  • The most powerful force in the universe.
Re: ULX Staff CHat help?
« Reply #17 on: March 14, 2018, 09:43:31 pm »
You would just go back into your original function and tell it to change the colors. I'll provide a small example of a admin only chat I wrote a little over a year ago and you can see how I made it work.

Code: Lua
  1. if not calling_ply:IsValid() then
  2.         ULib.tsayColor( v, 1, "(Admin Chat)", console, "(Console)", admin, ": ", message )
  3. else
  4.         ULib.tsayColor( v, 1, "(Admin Chat) ", team.GetColor(calling_ply:Team()), calling_ply:Nick(), admin, ": ", message )
  5. end

Basically I made utilization of the ULib.tsayColor() function to give my chat some pretty colors. Now in my example I used some predefined terms like 'admin' and 'console' and all of that to avoid clutter. Those were something like

Code: Lua
  1. local console = Color(0, 0, 0)
  2. local admin = Color(0, 255, 242)

Now the above is just a small snippet to show you how I handled colors, not the entire command. I do remember I made a post when making those a while ago so if you do some digging you can probably find close to what they turned out to be if you want the full thing but what I provided above is how I handled colors.

If you're running a DarkRP server then team.GetColor(ply:Team()) will return what color their job is, TTT will return living/dead and Sandbox will return just whatever you have team colors set to be.


Offline admiralmirage

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: ULX Staff CHat help?
« Reply #18 on: March 14, 2018, 09:53:27 pm »
Thank you so much! I will mess with it and see how it goes!

  • Print