Tópico: [L2JServer] Comando .online
Ver um Único Post
Antigo 12-07-2009, 12:16 AM   #2 (permalink)
lemile
Banido
 
Avatar de lemile
 
Registrado em: Feb 2009
Posts: 22
Agradeceu: 119
Agradecido 61 Vezes em 11 Posts
Achei Ruim:
Acharam ruim Vezes em Posts

Inventório de lemile

Padrão Poderia explicar direito?

explica direito pq coloquei asim crieii essa pasta {handler} depois coloqueii um bloco de notas com essas seguintes formas
Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
Index: /java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java
===================================================================
--- /java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java   (revision 0)
+++ /java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java   (revision 0)
@@ -0,0 +1,59 @@
+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.network.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 Online 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);
+}
+
+
+}
falta oq? poderia explicar ou postar pra min porfavo'?

lemile está offline   Responder com Citação
 

Search Engine Optimization by vBSEO 3.3.0