Jump to content
  • 0

[Help]Change Text Color!


Question

Posted

Well i have this Welcome Text...

 

        if (Config.CUSTOM_WELCOME_TEXT)
        {
        		activeChar.sendMessage("Welcome to Our Server!!!");
        	}

 

AND when i log under announces is smthing like that...

 

Chat Window

Announcements:etc etc etc etc

Announcements:etc etc etc etc

Announcements:etc etc etc etc

Announcements:etc etc etc etc

Welcome to Our Server!!!

Entering in invul mod..

 

and i want to make smthing like that..

 

Announcements:etc etc etc etc

Announcements:etc etc etc etc

Announcements:etc etc etc etc

Announcements:etc etc etc etc

Welcome to Our Server!!!

Entering in invul mod..

 

I want to change the text color but i dont know how.. Thanks.. Help me if you can

9 answers to this question

Recommended Posts

  • 0
Posted

Its quite simple. You can use Say2.Party

 

You can use my little sample class:

 

package java.eu.l2jcustom.manager;

import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;

/**
* @author Matim
* Description: Green Message
*/
public class CustomMessage {

protected int chatType = Say2.PARTY; 
protected L2PcInstance player;
protected String author = "Server: ";

/**
 * @param text
 */
public void greeneMessage(String text)
{
	player.sendPacket(new CreatureSay(0, chatType, author, text));
}
}

 

Now You can use this void:

 

greeneMessage("Your Message Here");

 

In game output:

 

Server: Your Message Here

 


 

I made this class only as an example, of cource you can use it.. or add this method in EnterWorld.java

 

/Edit: Ahh.. and if you wish to use this class don't forget to change variables to static, and this void should be static too.

  • 0
Posted

yy i made it

 

So it works?

 

(I know it works .. for me, bu whats about you..xD)

  • 0
Posted

So it works?

 

(I know it works .. for me, bu whats about you..xD)

yeap it work.. but before you post i found another Way..

I have a modification about Welcome PM

and i changed this:

 

     

 if (Config.SHOW_WELCOME_PM)
        {
           CreatureSay np = new CreatureSay(0, Say2.TELL,Config.PM_FROM,Config.PM_TEXT1);

Say2.TELL --> Say2.PARTY

 

and your way is ok... :D Thanks.. Ventic Lock it:D

  • 0
Posted

yeap it work.. but before you post i found another Way..

I have a modification about Welcome PM

and i changed this:

 

     

 if (Config.SHOW_WELCOME_PM)
        {
           CreatureSay np = new CreatureSay(0, Say2.TELL,Config.PM_FROM,Config.PM_TEXT1);

Say2.TELL --> Say2.PARTY

 

and your way is ok... :D Thanks.. Ventic Lock it:D

k

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock