Ombladon1991 Posted May 7, 2008 Posted May 7, 2008 ok i wrote a little voice command that shows the online players to the one that calls it Curent ver: Kamael:Hellbound or ct1.5 :P package net.sf.l2j.gameserver.handler.voicedcommandhandlers; import net.sf.l2j.gameserver.model.L2World; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.serverpackets.SystemMessage; import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; /** * * @author Ombladon * * this class... * shows the amount of online players to any1 who calls it. */ public class OnlinePlayers implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = {"online"}; public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (command.startsWith("online")) { showPlayers(activeChar, target); } return true; } public String[] getVoicedCommandList() { return VOICED_COMMANDS; } public void showPlayers (L2PcInstance player, String target) { SystemMessage sm = new SystemMessage(SystemMessageId.S1); sm = new SystemMessage(SystemMessageId.S1); sm.addString("======<Online Players>======"); player.sendPacket(sm); sm = new SystemMessage(SystemMessageId.S1); sm.addString("There are "+L2World.getInstance().getAllPlayers().size()+" players on."); player.sendPacket(sm); sm = new SystemMessage(SystemMessageId.S1); sm.addString("======================="); player.sendPacket(sm); } } Cheerz, ¤!¦•[†OmbladoN†]•¦!¤
Ombladon1991 Posted May 7, 2008 Author Posted May 7, 2008 lol just put that file in : net.sf.l2j.gameserver.handler.voicedcommandhandlers and register it in net.sf.l2j.gameserver.GameServer.java using this code: Index: D:/L2J/workspace/Hellbound/java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- D:/L2J/workspace/Hellbound/java/net/sf/l2j/gameserver/GameServer.java (revision 2048) +++ D:/L2J/workspace/Hellbound/java/net/sf/l2j/gameserver/GameServer.java (working copy) @@ -204,6 +204,7 @@ import net.sf.l2j.gameserver.handler.usercommandhandlers.PartyInfo; import net.sf.l2j.gameserver.handler.usercommandhandlers.Time; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Banking; +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.OnlinePlayers; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats; import net.sf.l2j.gameserver.idfactory.IdFactory; @@ -631,6 +632,7 @@ _voicedCommandHandler = VoicedCommandHandler.getInstance(); _voicedCommandHandler.registerVoicedCommandHandler(new stats()); + _voicedCommandHandler.registerVoicedCommandHandler(new OnlinePlayers()); if(Config.L2JMOD_ALLOW_WEDDING) _voicedCommandHandler.registerVoicedCommandHandler(new Wedding());
Mijuki Posted May 21, 2008 Posted May 21, 2008 Tony Montana When you Check Out L2j Free have it command .bank .online and .wedding.... You need sources files to complete and create a new java file. u have only server compile you cant.
Ombladon1991 Posted December 16, 2008 Author Posted December 16, 2008 well... i first posted this mod on l2jserver.... it probably was implemented into l2jfree too :P
Intrepid Posted October 3, 2009 Posted October 3, 2009 nice ombladon:D 1year old topic bumped 1st warning
Recommended Posts