Jump to content

Recommended Posts

Posted

//sit - click target and player you target will sit down

//stand - click target and player you target will stand up

//rangesit - players in 240 radius will sit down

//rangestand - players in 240 radius will stand up

 

/**
* 
*/
package handlers.admincommandhandlers;

import java.util.Collection;

import com.l2jserver.gameserver.handler.IAdminCommandHandler;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

/**
* @author Ventic
*
*/
public class AdminSit implements IAdminCommandHandler
{
private static final String[] ADMIN_COMMANDS = { "sit" , "stand", "rangesit", "rangestand" };

@Override
public boolean useAdminCommand(String command, L2PcInstance activeChar)
{
	if (command.startsWith("sit"))
	{
		L2Object target = activeChar.getTarget();
		if (target == null)
		{
			activeChar.sendMessage("No target found");
			return false;
		}
		else
		{
				((L2PcInstance) target).sitDown();
		}
		if (command.startsWith("stand"))
		{
			L2Object targetPc = activeChar.getTarget();
			if (targetPc == null)
			{
				activeChar.sendMessage("No target found");
				return false;
			}
			else
			{
					((L2PcInstance) targetPc).standUp();
			}
		}
		if (command.startsWith("rangesit"))
		{
			Collection<L2Character> players = activeChar.getKnownList().getKnownCharactersInRadius(240);

			for (L2Character p : players)
			{
				if (p instanceof L2PcInstance)
				{
					((L2PcInstance) p).sitDown();
				}
				else
				{
					if (p == null)
					{
						activeChar.sendMessage("No players found so close");
						return false;
					}
				}
			}
		}
		if (command.startsWith("rangestand"))
		{
			Collection <L2Character> playersPc = activeChar.getKnownList().getKnownCharactersInRadius(240);

			for (L2Character pPc : playersPc)
			{
				if (pPc instanceof L2PcInstance)
				{
					((L2PcInstance) pPc).standUp();
				}
				else
				{
					if (pPc == null)
					{
						activeChar.sendMessage("No players found so close");
						return false;
					}
				}
			}

		}
	}
	return true;
}

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

 

Idea Dialogos

Credits,coded by me

 

ps:dont forget to register it

Posted

One question[no reason], you have coded in Hi5 or freya l2j? Because i see the com.l2jserver

epilogue but really it doesnt matter
  • 1 month later...
Posted

usefully for events!

very interesting!

 

Quite easy,anyway thanks for sharing it.

 

LOLS? [Hidden post: You need 150 posts to see it. You currently have 45.]

  • 1 year later...
Posted

the code is not working... thats the real code

/**
* 
*/
package net.sf.l2j.gameserver.handler.admincommandhandlers;

import java.util.Collection;

import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
import net.sf.l2j.gameserver.model.L2Object;
import net.sf.l2j.gameserver.model.L2Character;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;

/**
* @author Ventic
*
*/
public class AdminSit implements IAdminCommandHandler
{
private static final String[] ADMIN_COMMANDS = { "admin_sit" , "admin_stand", "admin_rangesit", "admin_rangestand" };

@Override
public boolean useAdminCommand(String command, L2PcInstance activeChar)
{
	if (command.startsWith("admin_sit"))
	{
		L2Object target = activeChar.getTarget();
		if (target instanceof L2NpcInstance)
		{
		   activeChar.sendMessage("You can not use it at NPCs!");
               return false;
		}
            else if (target == null)
		{
			activeChar.sendMessage("You have no target!");
            return false;
		}
		else
		{
			((L2PcInstance) target).sitDown();
		}
	}

	if (command.startsWith("admin_stand"))
	{
		L2Object target = activeChar.getTarget();
		if (target instanceof L2NpcInstance)
		{
		   activeChar.sendMessage("You can not use it at NPCs!");
               return false;
		}
            else if (target == null)
		{
			activeChar.sendMessage("You have no target!");
            return false;
		}
		else
		{
			((L2PcInstance) target).standUp();
		}
	}

	if (command.startsWith("admin_rangesit"))
	{
		Collection<L2Character> players = activeChar.getKnownList().getKnownCharactersInRadius(240);
		for (L2Character p : players)
		{
			if (p instanceof L2PcInstance)
			{
				((L2PcInstance) p).sitDown();
			}
		}
	}

	if (command.startsWith("admin_rangestand"))
	{
		Collection <L2Character> players = activeChar.getKnownList().getKnownCharactersInRadius(240);
		for (L2Character p : players)
		{
			if (p instanceof L2PcInstance)
			{
				((L2PcInstance) p).standUp();
			}
		}

	}
return true;

}

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

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

    • Lineage 2 Interlude Developer – Cliente + Datapack Hola, soy developer especializado en Lineage 2 Interlude con experiencia tanto en cliente como datapack/core. ✔ Desarrollo datapack (Java, scripts, quests, balance PvP/PvE) ✔ Fixes core / geodata / exploits ✔ Sistemas custom (events, Olympiad, instancias, mods PvP) ✔ Cliente: interface mods, system patches, .dat edits, UI personalizada ✔ Optimización y estabilidad de servidor ✔ Trabajo freelance o colaboración fija Si necesitáis soporte dev o mejoras para vuestro servidor Interlude, podéis contactarme por DM. Portfolio y ejemplos disponibles bajo petición.
    • THEY DON’T COME BACK FOR NO REASON. HERE’S WHY Our clients come from different countries and with very different tasks. But the strongest indicator of quality is simple — when a client comes back **for a second time**. This case is exactly that. The client returned with a request for a **German ID**. The requirement was clear: a document **in a male hand**, with a natural live scene and correct geographic context. What we did: ▪ accepted source files and data without unnecessary bureaucracy ▪ selected a **real street**, not a generic background ▪ built a print-ready mockup with correct scene logic ▪ sent it for approval ▪ after confirmation, delivered the **final file for printing** No templates. No “good enough”. Only solutions tailored to a specific task. Result: ▪ mockup approved on the first try ▪ client fully satisfied ▪ stays in touch We work **worldwide** — and that’s exactly why clients return. Contact us › TG: @mustang_service ( https:// t.me/ mustang_service ) › Channel: Mustang Service ( https:// t.me/ +6RAKokIn5ItmYjEx ) *All data is published with the client’s consent.* #redraw #verification #documents #case #ID
    • Lineage 2 Interlude Developer – Cliente + Datapack Hola, soy developer especializado en Lineage 2 Interlude con experiencia tanto en cliente como datapack/core. ✔ Desarrollo datapack (Java, scripts, quests, balance PvP/PvE) ✔ Fixes core / geodata / exploits ✔ Sistemas custom (events, Olympiad, instancias, mods PvP) ✔ Cliente: interface mods, system patches, .dat edits, UI personalizada ✔ Optimización y estabilidad de servidor ✔ Trabajo freelance o colaboración fija Si necesitáis soporte dev o mejoras para vuestro servidor Interlude, podéis contactarme por DM. Portfolio y ejemplos disponibles bajo petición.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..