Plugin SkyWars

Discussion in 'Plugin Development' started by tg95, Nov 18, 2015.

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

    tg95

    Hello, i create plugin skyWars for my server, but, i have a problem, on players join on Minigame i need a function for teleport to "capsules".

    my problem is:

    exemple: enter 5 players on minigame

    Player 1: Capsules 1
    Player 2: Capsules 2
    Player 3: Capsules 3
    Player 4: Capsules 4
    Player 5: Capsules 5

    Ok but player 2 leave, how i do for "plugin" know, capsules 2 is empty?

    thanks for help and sorry for my bad english.
     
  2. Offline

    Gamesareme

    @tg95 You can add a check for a player leave event. If so, check if they are in any areners. If they are run through all the players in the arena and see if they are null. If they have left the capsule they are in (or the player object) will no longer be.

    Code:
    for(Player player : arena.getPlayers()){
         if player is null{
              //You have found where the player was before they left.
          }
    }
     
  3. Offline

    teej107

    @tg95 What happens when a Player leaves? What Object is representing a capsule/capsules?
     
  4. Offline

    tg95

    My plugin is create on single servers, on player join count, but my problem is exemple i say on quest...

    thanks for all.
     
Thread Status:
Not open for further replies.

Share This Page