Plugin Help Plugin Help

Discussion in 'Plugin Help/Development/Requests' started by LewisOSF, Oct 11, 2015.

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

    LewisOSF

    Hey guys, I have made a skywars plugin for my server but I am really struggling with the starting mechanism, I want to restart the countdown when there isn't enough players online ect...

    Here is the error I get: http://hastebin.com/ediqeqifes.avrasm

    Join Event that starts the countdown initially: http://hastebin.com/eqebafotex.avrasm

    Countdown that will go until there are enough players (this is the one I want to reset when there isn't enough players but I can't): http://hastebin.com/bevarewofu.avrasm

    Warmup Countdown (If there are enough players in the lobby it will then teleport to the skyblock spawns and do another short countdown): http://hastebin.com/volubexige.avrasm

    And here is my Task Manager class: http://hastebin.com/ajahumiqaj.avrasm


    If anyone can help me that will be amazing, sorry if I made it look really complicated and this is probably a really easy fix? I just have no idea how to fix it and have spent over an hour trying to fix it, this is my last resort! :(
     
  2. Offline

    timtower Administrator Administrator Moderator

    @LewisOSF Your current error tells that you can't start it twice.
     
  3. Offline

    LewisOSF

    It does? Where am i starting it twice?
     
  4. Offline

    timtower Administrator Administrator Moderator

    You are starting it on every join.
    TaskManager.activateStartLobbyCountdown();
     
  5. Offline

    LewisOSF

    So how will I get around it? I want to restart the timer if it sees that not enough players.. I'm so confused by what I have to to :(

    Shall I start it onEnable and have it run through as many times untill there enough players to join instead of having it on player join?

    EDIT by Timtower: merged posts, please use the edit button instead of double posting.
     
  6. Offline

    timtower Administrator Administrator Moderator

    @LewisOSF Why not just check the amount of players in the join event?
     
  7. Offline

    LewisOSF

    Oh okay, I can try
     
  8. Offline

    timtower Administrator Administrator Moderator

    Instead of a timer just check: server.getOnlinePlayers().size()>=(someamounthere)
     
  9. Offline

    LewisOSF

    I have no idea how to do it xD I have this still in my StartLobbyCountdown class: http://hastebin.com/vometoxute.avrasm

    --

    How will I then restart the countdown?


    {{Posts merged by Myrathi}}
     
    Last edited by a moderator: Oct 11, 2015
  10. Offline

    timtower Administrator Administrator Moderator

    @LewisOSF You set timeUntilStart to 10 again?
     
  11. Offline

    LewisOSF

    LOOL I'm so fucking dumb, didn't even think of that.. Thanks buddy :p
     
Thread Status:
Not open for further replies.

Share This Page