Jump to content

[Share] .status [Online pll & time]


DominiQue
 Share

Recommended Posts

/*

* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.

*/

 

/**

*

* @author x.v3ndetta@yahoo.com

*

*/

 

package com.l2zone.gameserver.handler.voicedcommandhandlers;

 

import com.l2zone.gameserver.GameTimeController;

import com.l2zone.gameserver.handler.IVoicedCommandHandler;

import com.l2zone.gameserver.model.L2World;

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

import com.l2zone.gameserver.network.SystemMessageId;

import com.l2zone.gameserver.network.serverpackets.SystemMessage;

 

public class status implements IVoicedCommandHandler

{

private static String[] _voicedCommands =

{

"status"

};

 

public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)

{

if (command.equalsIgnoreCase("status"))

{

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

}

else

   {

 

 

int t = GameTimeController.getInstance().getGameTime();

String h = "" + (t/60)%24;

String m;

if (t%60 < 10)

m = "0" + t%60;

else

m = "" + t%60;

 

 

 

SystemMessage sm;

if (GameTimeController.getInstance().isNowNight()) {

sm = new SystemMessage(SystemMessageId.TIME_S1_S2_IN_THE_NIGHT);

        sm.addString(h);

        sm.addString(m);

}

else {

sm = new SystemMessage(SystemMessageId.TIME_S1_S2_IN_THE_DAY);

      sm.addString(h);

        sm.addString(m);

}

       activeChar.sendPacket(sm);

       return true;

   }

return true;

}

 

public String[] getVoicedCommandList()

{

return _voicedCommands;

}

}

 

Not more .online :) .status and will show you Online players and Server Time

 

CREDITS : V3ndetta[ME}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock