Author Topic: Create a chatroom ?  (Read 1929 times)

0 Members and 1 Guest are viewing this topic.

Offline Elfarouch

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Create a chatroom ?
« on: April 04, 2016, 06:21:28 AM »
Hi !
I try to create a chatroom for my admins (and superadmin) (not for users) but i am a beginner in lua coding and i think i need some help please..
I took asay command as a base for the new command but i'm stuck with...

I know that asay can work as an admin chat but i want to have a chat like that :

[ADMIN]PLAYERNAME : BLABLABLA

But in the asay comand there is "#P to admin #S" which put a color of the XGUI and I don't want to use it because I want to create 2 chatrooms
with differents colors..

Could you help me please ? :)

Thanks you !!

PS: Sorry for my bad english, it is not my first langage.. :c


Elfa

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Create a chatroom ?
« Reply #1 on: April 04, 2016, 08:11:50 AM »
I'm not entirely sure how ulx.fancyLog() works, but I'm 99% sure that format should not be set to the return value of ULib.tsayColor. I don't even think tsayColor returns anything.

I'm also not entirely sure what you want your code to do, and what issue you're running into. Could you tell us your native language, and maybe one of us could translate (or find a translator)? You say you want two different chatrooms with different colors, you should be able to accomplish that with just ULib.tsayColor(). Just let the function know which chatroom you want to use and then change the colors accordingly with an if statement.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Elfarouch

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Create a chatroom ?
« Reply #2 on: April 04, 2016, 08:39:18 AM »
Thanks you for your answer !
Indeed, I want to create two different chatrooms for my players.. So, is it possible with Ulib.tsaysColor() ? I tried some things but I don't did it..
Have you some ideas to help me in my quest ? o:-)

I'm french, that is the reason of my bad english :c

Translation into french:

Merci pour votre réponse !
En effet, J'aimerais créer deux différents chat pour mes joueurs.. Donc, c'est possible avec Ulib.tsayColor() ? J'ai essayé plusieurs choses mais je n'ai pas réussi...
Avez-vous quelques idées pour m'aider dans ma quête ? o:-)

Je suis français, c'est la raison de mon mauvais anglais :c

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Create a chatroom ?
« Reply #3 on: April 04, 2016, 11:50:15 AM »
I believe Mr. President speaks french, so he might be able to help.

In the meantime I'll do my best. So, how do you want to send messages to specific chat rooms? Do you want one command for all chatrooms and then choose which room to send the message to, or have separate commands for each chatroom?

Could you explain what you tried and why they didn't work for you? Do you want the different chatrooms to just be different colors, or should they be different in other ways?
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.