Jump to content

Recommended Posts

  • 1 month later...
Posted

as i can see you use the Say2.PARTYROOM_COMMANDER (`)..

hmm.. you could select the color with other way? cause chat handlers colors are limited..

(orange for all, green for party etc)

 

  • 3 months later...
Posted

hello my cliente freya look error

 

2yovqm1.jpg

 

 

look my cod

 

 

/*

* 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 handlers.admincommandhandlers;

 

import java.util.logging.Logger;

 

import br.xtreme.Config;

import br.xtreme.gameserver.GmListTable;

import br.xtreme.gameserver.handler.IAdminCommandHandler;

import br.xtreme.gameserver.model.L2Object;

import br.xtreme.gameserver.model.L2World;

import br.xtreme.gameserver.model.actor.instance.L2PcInstance;

import br.xtreme.gameserver.network.SystemMessageId;

import br.xtreme.gameserver.network.clientpackets.Say2;

import br.xtreme.gameserver.network.serverpackets.CreatureSay;

import br.xtreme.gameserver.network.serverpackets.SystemMessage;

 

/**

* This class handles following admin commands:

* - gmchat text = sends text to all online GM's

* - gmchat_menu text = same as gmchat, displays the admin panel after chat

*

* @version $Revision: 1.2.4.3 $ $Date: 2005/04/11 10:06:06 $

*/

public class AdminGmChat implements IAdminCommandHandler

{

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

private static final String[] ADMIN_COMMANDS =

{

"admin_gmchat",

"admin_snoop",

"admin_gmchat_menu"

};

 

public boolean useAdminCommand(String command, L2PcInstance activeChar)

{

if (Config.ENABLE_SAFE_ADMIN_PROTECTION)

{

if (!activeChar.isSafeAdmin())

{

activeChar.punishUnSafeAdmin();

_log.warning("Character " + activeChar.getName() + "(" + activeChar.getObjectId() + ") tryed to use an admin command.");

return false;

}

}

if (command.startsWith("admin_gmchat"))

handleGmChat(command, activeChar);

else if (command.startsWith("admin_snoop"))

snoop(command, activeChar);

if (command.startsWith("admin_gmchat_menu"))

AdminHelpPage.showHelpPage(activeChar, "gm_menu.htm");

return true;

}

 

/**

* @param command

* @param activeChar

*/

private void snoop(String command, L2PcInstance activeChar)

{

L2Object target = null;

if (command.length() > 12)

{

target = L2World.getInstance().getPlayer(command.substring(12));

}

if (target == null)

target = activeChar.getTarget();

 

if (target == null)

{

activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.SELECT_TARGET));

return;

}

if (!(target instanceof L2PcInstance))

{

activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.INCORRECT_TARGET));

return;

}

L2PcInstance player = (L2PcInstance) target;

player.addSnooper(activeChar);

activeChar.addSnooped(player);

}

 

public String[] getAdminCommandList()

{

return ADMIN_COMMANDS;

}

 

/**

* @param command

* @param activeChar

*/

private void handleGmChat(String command, L2PcInstance activeChar)

{

try

{

int offset = 0;

String text;

if (command.startsWith("admin_gmchat_menu"))

offset = 18;

else

offset = 13;

text = command.substring(offset);

CreatureSay cs = new CreatureSay(0, Say2.PARTYROOM_COMMANDER, "[staff]"+activeChar.getName(), text);

Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();

for (L2PcInstance player : pls) 

{

  player.sendPacket(cs);

}

}

catch (StringIndexOutOfBoundsException e)

{

// empty message.. ignore

}

}

}

 

Posted

/*

* 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 handlers.admincommandhandlers;

 

import java.util.logging.Logger;

 

import java.util.Collection

 

import br.xtreme.gameserver.handler.IAdminCommandHandler;

import br.xtreme.gameserver.model.L2Object;

import br.xtreme.gameserver.model.L2World;

import br.xtreme.gameserver.model.actor.instance.L2PcInstance;

import br.xtreme.gameserver.network.SystemMessageId;

import br.xtreme.gameserver.network.clientpackets.Say2;

import br.xtreme.gameserver.network.serverpackets.CreatureSay;

import br.xtreme.gameserver.network.serverpackets.SystemMessage;

 

/**

* This class handles following admin commands:

* - gmchat text = sends text to all online GM's

* - gmchat_menu text = same as gmchat, displays the admin panel after chat

*

* @version $Revision: 1.2.4.3 $ $Date: 2005/04/11 10:06:06 $

*/

public class AdminGmChat implements IAdminCommandHandler

{

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

private static final String[] ADMIN_COMMANDS =

{

"admin_gmchat",

"admin_snoop",

"admin_gmchat_menu"

};

 

public boolean useAdminCommand(String command, L2PcInstance activeChar)

{

if (Config.ENABLE_SAFE_ADMIN_PROTECTION)

{

if (!activeChar.isSafeAdmin())

{

activeChar.punishUnSafeAdmin();

_log.warning("Character " + activeChar.getName() + "(" + activeChar.getObjectId() + ") tryed to use an admin command.");

return false;

}

}

if (command.startsWith("admin_gmchat"))

handleGmChat(command, activeChar);

else if (command.startsWith("admin_snoop"))

snoop(command, activeChar);

if (command.startsWith("admin_gmchat_menu"))

AdminHelpPage.showHelpPage(activeChar, "gm_menu.htm");

return true;

}

 

/**

* @param command

* @param activeChar

*/

private void snoop(String command, L2PcInstance activeChar)

{

L2Object target = null;

if (command.length() > 12)

{

target = L2World.getInstance().getPlayer(command.substring(12));

}

if (target == null)

target = activeChar.getTarget();

 

if (target == null)

{

activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.SELECT_TARGET));

return;

}

if (!(target instanceof L2PcInstance))

{

activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.INCORRECT_TARGET));

return;

}

L2PcInstance player = (L2PcInstance) target;

player.addSnooper(activeChar);

activeChar.addSnooped(player);

}

 

public String[] getAdminCommandList()

{

return ADMIN_COMMANDS;

}

 

/**

* @param command

* @param activeChar

*/

private void handleGmChat(String command, L2PcInstance activeChar)

{

try

{

int offset = 0;

String text;

if (command.startsWith("admin_gmchat_menu"))

offset = 18;

else

offset = 13;

text = command.substring(offset);

CreatureSay cs = new CreatureSay(0, Say2.PARTYROOM_COMMANDER, "[staff]"+activeChar.getName(), text);

Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();

for (L2PcInstance player : pls) 

{

  player.sendPacket(cs);

}

}

catch (StringIndexOutOfBoundsException e)

{

// empty message.. ignore

}

}

}

 

try heliocsQQ

 

sorry for doblepost.

Posted

Rework please

1. ERROR in D:\L2J 2011 HIGH FIVE\L2J_Server\game\data\scripts\han

dlers\admincommandhandlers\AdminGmChat.java (at line 108)

        Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().val

ues();

                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^

Type mismatch: cannot convert from L2PcInstance[] to Collection<L2PcInstance>

----------

1 problem (1 error)Type mismatch: cannot convert from com.l2jserver.gameserver.m

odel.actor.instance.L2PcInstance[] to java.util.Collection<com.l2jserver.gameser

ver.model.actor.instance.L2PcInstance>

Failed executing script: D:\L2J 2011 HIGH FIVE\L2J_Server\game\dat

a\scripts\handlers\MasterHandler.java. See MasterHandler.java.error.log for deta

ils.

Posted

Rework please

1. ERROR in D:\L2J 2011 HIGH FIVE\L2J_Server\game\data\scripts\han

dlers\admincommandhandlers\AdminGmChat.java (at line 108)

        Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().val

ues();

                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^

Type mismatch: cannot convert from L2PcInstance[] to Collection<L2PcInstance>

----------

1 problem (1 error)Type mismatch: cannot convert from com.l2jserver.gameserver.m

odel.actor.instance.L2PcInstance[] to java.util.Collection<com.l2jserver.gameser

ver.model.actor.instance.L2PcInstance>

Failed executing script: D:\L2J 2011 HIGH FIVE\L2J_Server\game\dat

a\scripts\handlers\MasterHandler.java. See MasterHandler.java.error.log for deta

ils.

 

 

Paste your file plz :)

Posted
/*
* 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 handlers.admincommandhandlers;
import java.util.Collection;
import com.l2jserver.gameserver.GmListTable;
import com.l2jserver.gameserver.handler.IAdminCommandHandler;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;

/**
* This class handles following admin commands:
* - gmchat text = sends text to all online GM's
* - gmchat_menu text = same as gmchat, displays the admin panel after chat
*
* @version $Revision: 1.2.4.3 $ $Date: 2005/04/11 10:06:06 $
*/
public class AdminGmChat implements IAdminCommandHandler
{

private static final String[] ADMIN_COMMANDS =
{
	"admin_gmchat",
	"admin_snoop",
	"admin_gmchat_menu"
};

@Override
public boolean useAdminCommand(String command, L2PcInstance activeChar)
{
	if (command.startsWith("admin_gmchat"))
		handleGmChat(command, activeChar);
	else if (command.startsWith("admin_snoop"))
		snoop(command, activeChar);
	if (command.startsWith("admin_gmchat_menu"))
		AdminHelpPage.showHelpPage(activeChar, "gm_menu.htm");
	return true;
}

/**
 * @param command
 * @param activeChar
 */
private void snoop(String command, L2PcInstance activeChar)
{
	L2Object target = null;
	if (command.length() > 12)
	{
		target = L2World.getInstance().getPlayer(command.substring(12));
	}
	if (target == null)
		target = activeChar.getTarget();

	if (target == null)
	{
		activeChar.sendPacket(SystemMessageId.SELECT_TARGET);
		return;
	}
	if (!(target instanceof L2PcInstance))
	{
		activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
		return;
	}
	L2PcInstance player = (L2PcInstance) target;
	player.addSnooper(activeChar);
	activeChar.addSnooped(player);
}

@Override
public String[] getAdminCommandList()
{
	return ADMIN_COMMANDS;
}

/**
 * @param command
 * @param activeChar
 */
private void handleGmChat(String command, L2PcInstance activeChar)
{
	try
	{
		int offset = 0;
		String text;
		if (command.startsWith("admin_gmchat_menu"))
			offset = 18;
		else
			offset = 13;
		text = command.substring(offset);
		//CreatureSay cs = new CreatureSay(0, Say2.ALLIANCE, activeChar.getName(), text);
		//GmListTable.broadcastToGMs(cs);
		CreatureSay cs = new CreatureSay(0, Say2.PARTYROOM_COMMANDER, "[staff]"+activeChar.getName(), text);
		Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
		for (L2PcInstance player : pls)   
		{
		   player.sendPacket(cs);
		}
	}
	catch (StringIndexOutOfBoundsException e)
	{
		// empty message.. ignore
	}
}
}

  • 2 weeks later...
  • 4 months later...

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

    • Good luck with your project!
    • Hola Fissban , che queria preguntarte algo estoy tratando de hacer que el testserver ande pro que cuando logeo y voy a elejir el servidor no aparece y he estado con la ia incluso buscando que puede ser pero no e logrado decifrarlo me darias una mano o alguien ?  
    • The Return of L2Elixir – A Legacy Reborn in 2025 Read more features: https://l2elixir.org/features/ It’s time to relive the magic. Many of you remember L2Elixir, first launched in 2008 – a server that brought players together, created friendships, rivalries, and unforgettable memories. For two+ incredible years, until its closure in 2010, Elixir was more than just a server… it was home. In 2018, a fake project borrowed the name and damaged that legacy, but the true memories of L2Elixir never died. Today, in 2025, we are proud to announce that a new dedicated team has taken up the mantle to bring L2Elixir back to life – with respect for the past and a fresh vision for the future.   What to Expect We’re not here to be “just another server.” Our mission is to bring back nostalgia with innovation, offering a unique progression experience: Interlude-Like start, capturing that classic old-school feeling. A natural evolution into Gracia Final. Followed by Gracia Epilogue, keeping the journey alive without losing balance. This is not a copy-paste server – it’s a carefully crafted world designed to honor the spirit of Lineage II while introducing fresh ideas to keep the gameplay alive and rewarding. Why L2Elixir? A balanced environment where community comes first. A project built with passion, not profit. A server that values longevity, fairness, and nostalgia.   📅 Launch Date & Details Closed Beta: Online. Open Beta & Rewards: November 15 & 21:00 UTC +2 Launch: November 28 & 21:00 UTC +2   🔗 Join the Community Be part of history once again. Follow our Discord, join the discussion, and prepare to step back into the world where legends were made.   https://l2elixir.org/ https://discord.gg/5ydPHvhbxs L2Elixir 2025 – Honoring the Past. Building the Future.
    • 10-24-2025 - OUR TOPIC IS RELEVANT! CONTACT US BY THE CONTACTS BELOW
    • Can someone decompile in classes this LineageSkilleffect.u ? I am willing to pay if needed,  protocol god any. https://wormhole.app/BEj0pr#osVXtnL9Q-AmmVmxOcEZfw found, ty
  • 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