• 0
Sign in to follow this  
StarSCreams

Help How to check the time has passed into switch kill in a row

Question

StarSCreams    0

hi,

I have this code and try to verify the time has passed when case occurred

Example in l2pcinstance:
 

private int assasins = 0;

switch(assasins) {
  case 2:
    Announcements.getInstance().announceToAll("Player " + pk.getName() + " has killed two times" + pk.getTarget().getName());
    break;
  case 3:
    Announcements.getInstance().announceToAll("Player " + pk.getName() + " has killed three times" + pk.getTarget().getName());
  default:
}

 

i need verify if the next kill (case 3) ocurred  < 10 seconds. if the time passed make a different announcements..

 

i think how see the code with my idea...

private int assasins = 0;
switch(assasins) {
  case 2:
    	Announcements.getInstance().announceToAll("Player " + pk.getName() + " has killed two times" + pk.getTarget().getName());
		ThreadPoolManager.getInstance().schedule(assasins = 3 , 10 * 1000);
    break;
  case 3:
    Announcements.getInstance().announceToAll("Player " + pk.getName() + " has killed" + pk.getTarget().getName());
		ThreadPoolManager.getInstance().schedule(assasins = 4 , 10 * 1000);
    break;
  default:
}

 

sorry my bad english :3

Share this post


Link to post
Share on other sites

34 answers to this question

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.



  • Similar Content

    • By gdelimpasis
      Hello people , I started this project about a week ago.
      It's a Patch Updater for an upcoming L2 Server.
      I want your opinions and suggestions on what to add or remove and of course if you like it.
       
      Automatic Self Updates like any game-launcher out there. Coded with VB.Net language with encryption as well. Links can be changed via URL without having to change any codes.  Able to change  the download path via .ini file outside or inside system folder. Images will be included as well. Not the PSD files due my copyrights. Automatic display latest news from WordPress Posts or text files Automatic Server status Report
       
    • By ChillStep
      Hello to everyone ! i want some help with buff icons .. you know l2 have really to big icons (buff icons) can i get something to make them smaller ? any help ? or any file .. ! i love the buff bar and icons from l2 classic .. to small and dont waste your free space .. ! if someone know about that . replay please ! thanks for your time :)
    • By ganjaradio
      Hello everyone.
      How can i make an instances that will last for ever and players will be able to be there all together?
    • By SillverShadow
      Can i change the range i can see static objects through any file or is it fixed?  @deMEV 
    • By tazerman2
      hello all i have a little problem with a event i try to fix auto create but all time use same
      player in multi add look photo image
      if any can experience or help to fix multi add or tell me whare is the problem for fix it
      code is this
      protected FastMap<PcInstance, int[]> players; public void createParty(int teamId) { int count = 0; Party party = null; FastList<PcInstance> list = new FastList<>(); for (PcInstance p : players.keySet()) if (getTeam(p) == teamId) list.add(p); FastList<PcInstance> sublist = new FastList<>(); for (PcInstance subPlayers : list) { if (count % 9 == 0 && list.size() - count != 1) { if (sublist.size() == 0) { sublist.add(subPlayers); } else { if (subPlayers.getParty() == null) { party = new Party(subPlayers, sublist.get(0), LootRule.ITEM_LOOTER); } else { if (party != null) party.addPartyMember(subPlayers); } sublist.reset(); sublist.add(subPlayers); } } if (count % 9 < 9) { sublist.add(subPlayers); } count++; } }  
  • Posts

  • Topics