Solved Hashmap and Scoreboard Help

Discussion in 'Plugin Development' started by sethrem, Oct 16, 2014.

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

    sethrem

    Hello fellow Bukkitians,
    I have recently been trying to make a one in the quiver minigame but I have an issue. The code provided below does not properly work. I'm trying to get it so only once a player kills another player their name gets put on the scoreboard, then the scoreboard gets formatted in kill order not my score, but the score corresponds with the players kills for example: 15(Kills) <playername> (scoreboard score), so that players name would be ontop of the scoreboard since he has the most kills. Here's my code.

    Thanks in advanced.
     
  2. Offline

    TheCodingCat

    So sethrem are you getting any errors? What seems to be the problem?
     
  3. Offline

    sethrem

    No errors just that for two of the three players i tested it with it doesnt show the scoreboard for the player who see's it the Scoreboard isnt organized by name from most kills to least since im using offlineplayers not the scoreboard score. And yea thats about it.
     
  4. Offline

    TheCodingCat

    you have to update the scoreboard for each user sethrem because the way you are doing it is per player scoreboards. When an update is made to the scoreboard, loop through online players and use the setScoreboard() function.
     
  5. Offline

    97WaterPolo

    sethrem
    As for the sorting, I would use the Collections.sort() method to have it so the scores scale.
     
  6. Offline

    sethrem

    Thanks but I already did that if you read the code.

    TheCodingCat Thanks for your previous advice I forgot to put that in for that scoreboard in specific because I have others like lobby etc. Also after tweaking the code a bit I got the board the show for everyone but the only problem is, is that The scoreboard doesn't correspond with the players names. P.S I've updated the thread with my new code to keep the comments section a bit cleaner.

    Edit: Here is a picture
    [​IMG]

    Image Info:
    SharpShooter actually has 5 kills
    Sethyz actually has 9 kills
    _Rem___ has 3 kills(correct)

    Edit: I have noticed by logging in, in a different order it actually throws off the whole scoreboard meaning the names are actually set depending on the players in order of who logged in first.

    Image:
    [​IMG]

    Bump.

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

    sethrem

    bump.
     
  8. Offline

    sethrem

    Bump.

    Edit: Fixed it myself, Thanks anyways for the people who tried to help.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
Thread Status:
Not open for further replies.

Share This Page