Jump to content
  • 0

Delay In Class Messages Exshowscreenmessage


l2jkain

Question

11 answers to this question

Recommended Posts

  • 0

Depends on the pack you're using, but here's an example for aCis.

activeChar.sendPacket(new ExShowScreenMessage("SCREEN MSG", 5000, SMPOS.TOP_CENTER, false));
Link to comment
Share on other sites

  • 0

I want this to appear after 10 seconds after the player logs on how? Because as soon as the play loga opens the days of vip they still have

 

 

if (Config.SERVER_TIME_ON_START)
activeChar.sendPacket(new ExShowScreenMessage("L2 Serve Time is " + fmt.format(new Date(System.currentTimeMillis())), 10000, 0x02, true));
Link to comment
Share on other sites

  • 0


if (Config.SERVER_TIME_ON_START)

ThreadPoolManager.getInstance().scheduleGeneral(() -> activeChar.sendPacket(new ExShowScreenMessage("L2 Serve Time is " + fmt.format(new Date(System.currentTimeMillis())), 10000, 0x02, true)), 10000);

 

Edited by Versus
Link to comment
Share on other sites

  • 0

ThreadPoolManager class exists in different variations among packs. Find the right class, the right method and the code i posted will work 100%.

Link to comment
Share on other sites

  • 0
It appears more of the vip no longer appears

 

 

if (Config.SERVER_TIME_ON_START)

            ThreadPool.schedule(() -> activeChar.sendPacket(new ExShowScreenMessage("L2 Serve Time is " + fmt.format(new Date(System.currentTimeMillis())), 10000, 0x02, true)), 10000);
Link to comment
Share on other sites

  • 0

@l2jkain I don't understand what you wanna say, anyway i think it's pretty simple..

 

That should work:

activeChar.sendPacket(new ExShowScreenMessage("VIP SCREEN MSG", 5000, SMPOS.TOP_CENTER, false));
if (Config.SERVER_TIME_ON_START) 
    ThreadPoolManager.getInstance().scheduleGeneral(() -> activeChar.sendPacket(new ExShowScreenMessage("L2 Serve Time is " + fmt.format(new Date(System.currentTimeMillis())), 5000, 0x02, true)), 6000);

@AccessDenied, the code you posted does exactly the same as what i posted. Only difference, the way i used can be done in 1 line.

Edited by Versus
Link to comment
Share on other sites

  • 0

@l2jkain I don't understand what you wanna say, anyway i think it's pretty simple..

 

That should work:

activeChar.sendPacket(new ExShowScreenMessage("VIP SCREEN MSG", 5000, SMPOS.TOP_CENTER, false));
if (Config.SERVER_TIME_ON_START) 
    ThreadPoolManager.getInstance().scheduleGeneral(() -> activeChar.sendPacket(new ExShowScreenMessage("L2 Serve Time is " + fmt.format(new Date(System.currentTimeMillis())), 5000, 0x02, true)), 6000);

@AccessDenied, the code you posted does exactly the same as what i posted. Only difference, the way i used can be done in 1 line.

You're silly kid, the code you write is only for Java 8, you cannot know what java v he uses.

 

JAVA 6-7:

ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
{
        @Override
	public void run()
	{
        }
}

JAVA 8:

ThreadPoolManager.getInstance().scheduleGeneral(() -> 
Edited by AccessDenied
Link to comment
Share on other sites

  • 0

You're silly kid, the code you write is only for Java 8, you cannot know what java v he uses.

Java 8 has been released since early 2014 and he's obviously using aCis, but yes call me a silly kid for trying to educate you.

Link to comment
Share on other sites

  • 0

Java 8 has been released since early 2014 and he's obviously using aCis, but yes call me a silly kid for trying to educate you.

awwwwwww u so cute :DDDDDDD

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
Answer this question...

×   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.



  • Posts

    • I use l2fandc files. I need a java code, I've been searching a lot and waiting for help. What I want to do is to teleport to the players doing pvp. So it's like finding the flag player. I found some files but they did not fit my system. I'm waiting for help..   EXAMPLE:     package handlers.bypasshandlers; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import com.l2jmobius.Config; import com.l2jmobius.commons.util.Rnd; import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.network.serverpackets.CreatureSay; /**  * @author Mobius (based on Tenkai pvpzone)  */ public class FindPvP implements IBypassHandler {     private static final String[] COMMANDS =     {         "FindPvP"     };          @Override     public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)     {         if (!Config.ENABLE_FIND_PVP || !target.isNpc())         {             return false;         }                  L2PcInstance mostPvP = null;         int max = -1;         for (L2PcInstance player : L2World.getInstance().getPlayers())         {             if ((player == null) //                 || (player.getPvpFlag() == 0) //                 || (player.getInstanceId() != 0) //                 || player.isGM() //                 || player.isInsideZone(ZoneId.PEACE) //                 || player.isInsideZone(ZoneId.SIEGE) //                 || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND))             {                 continue;             }                          int count = 0;             for (L2PcInstance pl : L2World.getInstance().getVisibleObjects(player, L2PcInstance.class))             {                 if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE))                 {                     count++;                 }             }                          if (count > max)             {                 max = count;                 mostPvP = player;             }         }                  if (mostPvP != null)         {             // Check if the player's clan is already outnumbering the PvP             if (activeChar.getClan() != null)             {                 Map<Integer, Integer> clanNumbers = new HashMap<>();                 int allyId = activeChar.getAllyId();                 if (allyId == 0)                 {                     allyId = activeChar.getClanId();                 }                 clanNumbers.put(allyId, 1);                 for (L2PcInstance known : L2World.getInstance().getVisibleObjects(mostPvP, L2PcInstance.class))                 {                     int knownAllyId = known.getAllyId();                     if (knownAllyId == 0)                     {                         knownAllyId = known.getClanId();                     }                     if (knownAllyId != 0)                     {                         if (clanNumbers.containsKey(knownAllyId))                         {                             clanNumbers.put(knownAllyId, clanNumbers.get(knownAllyId) + 1);                         }                         else                         {                             clanNumbers.put(knownAllyId, 1);                         }                     }                 }                                  int biggestAllyId = 0;                 int biggestAmount = 2;                 for (Entry<Integer, Integer> clanNumber : clanNumbers.entrySet())                 {                     if (clanNumber.getValue() > biggestAmount)                     {                         biggestAllyId = clanNumber.getKey();                         biggestAmount = clanNumber.getValue();                     }                 }                                  if (biggestAllyId == allyId)                 {                     activeChar.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, your clan/ally is outnumbering the place already so you can't move there."));                     return true;                 }             }                          activeChar.teleToLocation((mostPvP.getX() + Rnd.get(300)) - 150, (mostPvP.getY() + Rnd.get(300)) - 150, mostPvP.getZ());             activeChar.setSpawnProtection(true);             if (!activeChar.isGM())             {                 activeChar.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);                 activeChar.startPvPFlag();             }         }         else         {             activeChar.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, I can't find anyone in flag status right now."));         }         return false;     }          @Override     public String[] getBypassList()     {         return COMMANDS;     } }
  • Topics

×
×
  • Create New...