Skip to content

[Help] Command \n

Featured Replies

Hello everybody!

 

I would like to place an order.

 

A mod block java command  \ n in chat l2

because it caused a huge headache ...

 

Thank you!

With you Conto

if u can be more explicit i can help you

Easy fix..

 

Just go to clientpackets/Say2.java

 

and add this

 

	if (_text.contains("\n"))
		_text.replace("\n", "");

 

it will replace all \n with space (blank)

  • Author

excuse-me for my bad english

 

view print

 

commandn.png

you are in wrong place...error about client here and i thyn is in systemmsg.dat

you are in wrong place...error about client here and i thyn is in systemmsg.dat

 

He is in the right section, btw, do as Versus told u but replace this with a letter, i think it will works, they will just spam a letter, and they will get chatbanned from the system, i'm i right?

 

This will maybe work...

	if (_text.contains("\n"))
		_text.replace("\n", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

 

The character will get chatbanned because it is something like he write too much letters to a message, or no?

  • Author

Versus the problem continues.

 

View Code:

 

	// player chat banned?
	if (activeChar.isChatBanned())
	{
		activeChar.checkBanChat(true);
		return;
	}


	+     // Block \n
	+      if (_text.contains("\n"))
	+	_text.replace("\n", "N");


	// player jailed?
	if (activeChar.isInJail() && Config.JAIL_DISABLE_CHAT)
	{
		if (_type == TELL || _type == SHOUT || _type == TRADE || _type == HERO_VOICE)
		{
			activeChar.sendMessage("You Have been Chat Banned");
			return;
		}
	}

What happens if you type in game \n? After you compiled your project with the code i gave you.

 

Btw to fix all your problems.. simply do that

 

	if (_text.contains("\n"))
		return;

 

Now when the player writes \n and hits enter nothing will happen, he won't write anything at the chat :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.