Skip to content

[Share] .status [Online pll & time]

Featured Replies

/*

* 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}

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.