Jump to content

Recommended Posts

Posted

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

Posted

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());

 

 

  • 2 weeks later...
Posted

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.

  • 6 months later...
  • 9 months later...
  • 5 months later...
Guest
This topic is now closed to further replies.


  • Posts

    • Hey MaxCheaters! 👋 Introducing L2Soon.com — a free international platform for Lineage 2 server announcements.   Why L2Soon? No more searching through dozens of forums and Discord servers. All new L2 server openings are in one place — updated daily, with real player online counts so you always know where people actually play.   Features: 🔔 Telegram Bot (@l2Soon_bot) — alerts 24h & 1h before server launch 📅 Accurate launch times — in your local timezone ⚔️ All chronicles — Interlude, High Five, GoD, Classic, Essence, Grand Crusade and more 🎯 Filters — by chronicle, rates (x1–x1000+) and server type (PvP, RvR, GvE, Craft, Low Rate...) ⭐ VIP servers — verified projects pinned at the top 🌍 Multi-language — EN, UK, RU, PT   Listing is completely FREE. 🔗 https://l2soon.com/en Feedback welcome — drop a comment or contact us via Telegram @l2Soon_bot
    • Download Lobby u need island for lobby Download Crow Island  
    • Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs    
    • L2-LORENA x100 MID RATE   Interlude Nostalgia Meets Modern Gameplay   OFFICIAL OPENING:  April 4 (Saturday)  19:00 UTC+1 ⸻  MAIN INFORMATION  Adena: x5  Drop: x10  Spoil: x10  Raid Boss: x10  Seal Stones: x2  Quests: x10 ⸻  FEATURES  GM Shop up to B-Grade  Full Buffer  Premium System (x2 bonuses)  AutoFarm – FREE for everyone ⸻  SERVER CONCEPT  Classic Interlude nostalgia  Enhanced with modern interface & mechanics  Balanced PvP & PvE gameplay  Active development & custom features ⸻  WHY JOIN L2-LORENA?  No Pay-to-Win  Smooth gameplay & stable server  Competitive PvP environment  Friendly & active community ⸻  JOIN US NOW L2-LORENA 100X <<< LINK Discord: https://discord.gg/TYZ88Tgx4b  Facebook: https://www.facebook.com/share/18kwbkaYZY/?mibextid=wwXIfr   L2-LORENA Link << Discord: https://discord.gg/TYZ88Tgx4b  Facebook: https://www.facebook.com/share/18kwbkaYZY/?mibextid=wwXIfr
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..