Jump to content

[Share]Online Player VC Script


Recommended Posts

edw sas exw Script ;) 

 

Online Players to mono p exete na kanete  einai na to kanete Copy paste

 

Index: D:/L2J/workspace/L2J release/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/OnlinePlayers.java
===================================================================
--- D:/L2J/workspace/L2J release/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/OnlinePlayers.java	(revision 0)
+++ D:/L2J/workspace/L2J release/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/OnlinePlayers.java	(revision 0)
@@ -0,0 +1,80 @@
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+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;
+
+/**
+ * 
+ *
+ * 
+ * this class...
+ * shows the amount of online players to anyone 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_S2);
+			sm = new SystemMessage(SystemMessageId.S1_S2);
+			sm.addString("======<Players Online>======");
+			player.sendPacket(sm);
+           	sm = new SystemMessage(SystemMessageId.S1_S2);	
+           	sm.addString("players online!");
+           	sm.addNumber(L2World.getInstance().getAllPlayers().size());
+           	player.sendPacket(sm);
+			sm = new SystemMessage(SystemMessageId.S1_S2);
+			sm.addString("=======================");
+			player.sendPacket(sm);
+			
+		}
+	}
+
+
+
+}
Index: D:/L2J/workspace/L2J release/java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- D:/L2J/workspace/L2J release/java/net/sf/l2j/gameserver/GameServer.java	(revision 1780)
+++ D:/L2J/workspace/L2J release/java/net/sf/l2j/gameserver/GameServer.java	(working copy)
@@ -197,6 +197,7 @@
import net.sf.l2j.gameserver.handler.usercommandhandlers.OlympiadStat;
import net.sf.l2j.gameserver.handler.usercommandhandlers.PartyInfo;
import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
+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;
@@ -614,6 +615,7 @@

		_voicedCommandHandler = VoicedCommandHandler.getInstance();
		_voicedCommandHandler.registerVoicedCommandHandler(new stats());
+		_voicedCommandHandler.registerVoicedCommandHandler(new OnlinePlayers());

		if(Config.L2JMOD_ALLOW_WEDDING)
			_voicedCommandHandler.registerVoicedCommandHandler(new Wedding());

Link to comment
Share on other sites

An Kai Yparxei 3ana To Topic Auto Kapoios Moderator Na To KAnei Move Sto Swsto Section....

 

Kai btw Otan kaneis Share Lege Kai Kati parapanw....:/

Polloi Den gnwrizoun ti einai auto....Tous Dineis Ena Diff patch kai den 3eroun ti na to kanoun... ;)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...