Jump to content

[Share]Sit,stand,rangesit,rangestand Admin Commands


Recommended Posts

//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

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

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;
}
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • 🔥Grand opening 11.10.2024 , 20:00 Berlin Time, 21:00 Greece Time, 19:00 UK Time.🔥 Siege reward real $$ , check our website for more info about Siege reward! Facebook / Discord Giveaways are running ,check discord and faceboook.   🔥Interlude Server with Classic Systems & Interface.🔥   Rates: » Xp 100x. » Sp 100. » Adena Custom. » Drop Custom. » Starting character level - 76.   Enchant rates: »Safe Enchant: +3. »Safe Enchant Full-Armor: +4. »Max Enchant: +25 (Weapons) +14 (Armors). »Enchanting Chance: Normal Scroll [3-14=66%] [15-25=33%] | Blessed Scroll [3-14=60%] [15-25=30%]. Farm System Dynamic Auto Farm Zones : »Giants Cave [AOE too] »Elven Fortress »Cemetery 1-2 Extra Non Dynamic Farm Zones »Ketra Orcs »Forge of the Gods »Blazing Swamp (Up the Hill) »Tower of Insolence(AOE) Info : use item Drop Search from Community Board for Further Info Unique features: » Light [good FPS] Server Interface . » Main Town: Aden Castle Town. » Spawn Protection. » Custom NPC's. » Auto Learn Skills. » Caslte Siege every week . » Class Balance. » Skill Balance. » Flood Protection. » Walker Protection. » Chaotic Zones. » Custom Dynamic Farm Zones. » Custom PvP Zones. » Chaotic PvP Zone. » Stuckable Scolls. » Stuckalble BOGS. » Anti-Buff Shield skill & Instance. » Auto loot mobs. » No Auto Loot on Raids. » Auto Enchant Included. » Auto Free Farm included. » Dungeons included , Solo/Party. » All sieges work. » 4(Four) Clan Hall Sieges fully working. » Daily Custom Mission Manager. » Achievements Manager . » Anti-Buff Shield skill & Instance. » Shift Click on NPCS. » Click Remove Buffs included. » Double Click & Remove unwanted buffs. » 99,99% Uptime. » Dos Protection. » Anticheat Protection. and much more..   Voiced commands: .menu .onlinetime .events .register .unregister .pveevent .join .leave .mail .farm .remove .away .back .enchant .stop .vote .mystats .playersearch Event system: » Team Blue VS Team Red » DeathMatch » Raid In The Middle » Ultra Rapid Fire » Korean Style » Hot Wars » Capture the Flag » High Rate » Squash Event » Dwarf Event » Boss Event » Hitman » Daily Killer » Monthly Top 3 Clans,1500-750-250 Donate Coins as reward » Chest Event, chance for 100DonateCoins per kill » Happy Days: Daily Bonus Stats: Example every sunday 2% more enchant rate + Exp Sp e.t.c Olympiad game: »Max A-Grade gear. No enchant limitations. »Class or Non-Class based or both matches (Not decided yet). »Duration: 1 hour per day. »Cycle: 1 week Monday [ Pause] »Heroes every Sunday at 00:00 . »Boosted Hero Skills, Weapons. »(with Noblesse Gate Pass Rewards like books, enchants.).   More and all features --> https://www.l2eurogold.com/features.html L2Eurogold Wiki --> https://www.l2eurogold.com/wiki.html Server Roadmap --> Will be opened publicly 03.10.2024 500E Siege Reward for Januar Castle Siege --> https://discord.gg/4PMKPdF8Nx 🌍Website --> www.l2eurogold.com 🌐Discord Join Now--> https://discord.gg/PrpYPZYthm Facebook Oficial Page --> https://www.facebook.com/profile.php?id=100067739556286 Facebook fan Page --> https://www.facebook.com/groups/655629177972237/    
    • New reviews URL: https://smartaim.cc/index.php?/forum/33-cs2-cheats-reviews/ Update on 20 September, 2024. Our CS2 software still safe to use.  
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/bDVQYKMUb3 https://campsite.bio/utchihaamkt  
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/bDVQYKMUb3 https://campsite.bio/utchihaamkt  
    • Alguém tem esse mod para l2jfrozen? Já procurei em todo lugar e não achei. Alguém poderia disponibilizar? 🙂
  • Topics

×
×
  • Create New...