Countdown HELP!

Discussion in 'Plugin Development' started by zakkinu2, Sep 19, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    zakkinu2

    Ok so i have been working on my first ever minigame for a while now and i dont wonna start over again, I have it so when a player creates a sign they join a list whenever a player join/leave on the 4th line on the signs there is a player counter for the list of the sign by doing this.getConfig.getStringList(list path...).size() it works good but now i came to a point where i want it so when there is atleast 2 players in the list it will start a separate timer for just that list and it will stop if the list.size ever goes down under 2. I really dont wonna start over again it my first one ever and i have been working on it for like 5 days straight, and the signs and stuff have a lot more stuff with them but that doesnt matter with this. Anyone have any ideas how i cna make the countdown timers?
     
  2. Offline

    xTrollxDudex

  3. Offline

    zakkinu2

    xTrollxDudex The thing is i have to make it in a way so the timer is only for the people in that list. and if another list that has 2 people in it and wants to start a new timer while the other one is working it will start butit wont effect the other one. i just want like separated timers basically. is it possible?
     
  4. Offline

    xTrollxDudex

    zakkinu2
    That depends on who you send the countdown to
     
  5. Offline

    zakkinu2

    xTrollxDudex Lets say there is a list witch activated a timer and it sends like 30 seconds left ect... to only the players in that list. and while that timer is working another list activates the timer and it does the same thing it tells the message only to the people in the list that activated it and it wont react to any other timers that are working.
     
  6. Offline

    xTrollxDudex

    zakkinu2
    That's really difficult to understand but I think you are trying to have multiple lists of players and have a separate countdown for each of them? You need objects to do this.
     
  7. Offline

    zakkinu2

    xTrollxDudex sorry about my english ... but thats exactly what i meant! how do i do it though?
     
  8. Offline

    xTrollxDudex

    zakkinu2
    When a player joins a game, check the size of the list and if it is the required size then start up a scheduler. When they leave, if it is below the players required to start a game, you would cancel the schedueler.
     
  9. Offline

    zakkinu2

    xTrollxDudex I already know how to test the size of the list and stuff but the problem is when i dont know how to do the schedueler works for multiple lists at 1 time. Cause whenever i try it i need to have an integer like:
    int x = 30;
    whenever i do x--; if another list activates the countdown it gets messed up and like the int will start going 2 times faster and stuff.

    xTrollxDudex its just i dont know how to do it. do you think you can show me how? the schedueler

    chasechocolate do you think you can help me i really need help i have been searching for over a whole day! please.



    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  10. Offline

    chasechocolate

    zakkinu2
    Code:java
    1. new BukkitRunnable(){
    2. int seconds = 60;
    3.  
    4. @Override
    5. public void run(){
    6. if(the arena size > 2){
    7. if(time > 0){
    8. //Broadcast message
    9.  
    10. time -= 1;
    11. } else {
    12. this.cancel();
    13. return;
    14. }
    15. } else {
    16. this.cancel();
    17. return;
    18. }
    19. }
    20. }
     
  11. Offline

    zakkinu2

    chasechocolate i tried a similar way to that the only problem is if an arena activates it and after like 7 seconds another arena activates it will mess up. thats why i want it to be separated for every list, if thats even possible?
     
  12. Offline

    chasechocolate

    zakkinu2 yeah, you would send a message to every player in a list. Check out xTrollxDudex 's arena tutorial in the resources section.
     
  13. Offline

    zakkinu2

  14. Offline

    xTrollxDudex

  15. Offline

    zakkinu2

    chasechocolate ok so i tried to understand what xTrollxDudex arena was about. but i still had problems understanding how he makes separate arenas and stuff. Now i know basic stuff like adding people to a list setup config and stuff with config and some event and like small stuff.. i know im not ready for that stuff yet. Where is the best place to learn all this stuff?
     
Thread Status:
Not open for further replies.

Share This Page