Toggling ScoreBoard Via command? and Converting a double on a scoreboard?

Discussion in 'Plugin Development' started by wptcraft, Aug 28, 2014.

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

    wptcraft

    Okay so im not to sure on how to Convert my kdr as Atm its a double and you cant display doubles on the scoreboard there for im not to sure on what to do? do i convert in into a string? if so how?

    My other Question is how can i add in a /toggle command to toggle the scoreboard on and off, so like /KSToggle turns it on if its off and off its its on?

    Thanks.
     
  2. Your first question, I don't understand.

    But for your second question, you have to hashmaps, one with a string(Player name) and a boolean (if the Scoreboard is toggled on). Then you have another hashmap with a string(Player name) and a Scoreboard. On the command you check if the boolean is true, then you set it to false and set the players scoreboard to Bukkit.getScoreboardManager().getNewScoreboard();. When the boolean is false, you set it to true and set the players scoreboard to the one in the hashmap.
     
  3. Offline

    CraftBang

    Your first question is easy to answer :p
    Lets say this:
    Double x = 200.0;
    String z = x + "";

    So shortened:
    String z = 200.0 + "";
    Done :)
     
Thread Status:
Not open for further replies.

Share This Page