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†]•¦!¤