Jump to content

Recommended Posts

Posted

hello all,one guy pmed me to help him with the online command of ventics share,because that code wasnt exactly for epilogue i made it so it can be

so here we go:

you have to go to   ------->>>>     datapack/data/scripts/voicedcommandhandlers file and create a new file name Online.java

 

there u put this code

 

/* This program is free software; you can redistribute it and/or modify */

package handlers.voicedcommandhandlers;

 

 

 

import com.l2jserver.gameserver.handler.IVoicedCommandHandler;

import com.l2jserver.gameserver.model.L2World;

import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

 

/**

*

* @author

*

* 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"))

{

activeChar.sendMessage("======<Online Players>======");

activeChar.sendMessage("There are "+L2World.getInstance().getAllPlayers().size()+" players online");

activeChar.sendMessage("=======================");

}return true;

 

}

 

 

 

public String[] getVoicedCommandList()

{

  return VOICED_COMMANDS;

}

}

 

Well because i havent seen in here how to register a handler in epilogue u need to go to data/scripts/masterhandler.java

 

find this and after it:

 

if (Config.BANKING_SYSTEM_ENABLED)

VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Banking());

 

add this:

 

   VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Online());

 

you have to enable banking system so the command online to works

 

thanks ventics share for the code

enjoy

its for l2j Gracia Epilogue ! !

 

 

 

 

Posted

Create a new config

 

if (Config.ONLINE_COMMAND_ENABLED)

AND you dont have to have Banking system enbled..

akthough shared 100 times something same,

thanks for share

Posted

Locked.

Because i guess who asked that.I mean what was so hard?.

You just change the imports

Nothing special,nothing hard

Even my friends who they dont know what Java is,they can do it

Guest
This topic is now closed to further replies.


×
×
  • Create New...