Jump to content
  • 0

Question

Posted

Hello, all commands . with this working, party chat also, etc. But normal chat doesnt, here mine chatall.java

Example i say HELLO, i see that i say, but other players doesnt see, with party chat all good.

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.l2j.gameserver.handler.chathandlers;

import java.util.StringTokenizer;
import java.util.logging.Logger;

import net.sf.l2j.Config;

import net.sf.l2j.gameserver.handler.IChatHandler;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
import net.sf.l2j.gameserver.model.BlockList;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;

/**
* A chat handler
* @author durgus
*/
public class ChatAll implements IChatHandler
{
private static final int[] COMMAND_IDS =
{
	0
};

private static Logger _log = Logger.getLogger(ChatAll.class.getName());

/**
 * Handle chat type 'all'
 * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String, java.lang.String)
 */
@Override
public void handleChat(int type, L2PcInstance activeChar, String params, String text)
{
			boolean vcd_used = false;
			if (text.startsWith("."))

	{
					StringTokenizer st = new StringTokenizer(text);
							IVoicedCommandHandler vch;
							String command = "";

							if (st.countTokens() > 1)
							{
								command = st.nextToken().substring(1);
								params = text.substring(command.length() + 2);
							vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler(command);
					}
							else
							{
								command = text.substring(1);
								if (Config.DEBUG)
									_log.info("Command: " + command);
								vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler(command);
							}
							if (vch != null)
							{
								vch.useVoicedCommand(command, activeChar, params);
								vcd_used = true;
						}
						else
						{
							if (Config.DEBUG)
								_log.warning("No handler registered for bypass '" + command + "'");
							vcd_used = false;
							}
	}

				if (!vcd_used) {
							CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);

						for (L2PcInstance player : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, 1250))
							{
								if (!BlockList.isBlocked(player, activeChar))
									player.sendPacket(cs);
							}

						activeChar.sendPacket(cs);
					}
}

/**
 * Returns the chat types registered to this handler
 * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
 */
@Override
public int[] getChatTypeList()
{
	return COMMAND_IDS;
}
}

2 answers to this question

Recommended Posts

  • 0
Posted

This is not aCis chatall.. Or i don't know if they changed it above 290 rev.

Anyway, try to replace this:

for (L2PcInstance player : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, 1250))
							{
								if (!BlockList.isBlocked(player, activeChar))
									player.sendPacket(cs);
							}

 

with this:

 

		for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers())
		{
			if (activeChar.isInsideRadius(player, 1250, false, true) && !BlockList.isBlocked(player, activeChar))
				player.sendPacket(cs);
		}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • There is a ready-made option and the possibility to work according to "Wishlist"
    • Contact me, Discord: xbaus
    • WTB GRACIA FINAL INTERFACE
    • Dear partners! At the moment we are in great need of the following positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old (brute or hacked origin, self-registered) accounts with post and comment karma from 100 to 100,000+ | Full email access included — LinkedIn old accounts with real connections | Geo: Europe/USA | Full email access + active 2FA password — Instagram old accounts (2010–2023) | Full email access (possibly with active 2FA password) — Facebook old accounts (2010–2023) | Full email access (possibly with active 2FA password) | With friends or without friends | Geo: Europe/USA/Asia — Threads accounts | Full email access (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts — Email accounts: mail.ru, yahoo.com, gazeta.pl, gmx.ch / gmx.de / gmx.net (BUT NOT gmx.com) — Google ADS Manual Farm accounts (verified via email and phone number) | GEO: USA/Europe, mostly USA. — WhatsApp OLD Accounts — Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! We are also ready to consider other partnership and collaboration options. Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • 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