Ranks

Discussion in 'Plugin Help/Development/Requests' started by RustyDesigns, Jul 31, 2015.

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

    RustyDesigns

    Hi Bukkit Forums! I was in search of some guidance, on how to add a players UUID, followed by a rank in a config on their first join to my server. I was also looking for how to change the rank. If you think that I should use another method, please explain it below.
     
  2. @RustyDesigns PlayerJoinEvent
    Check if they are new. Player#hasPlayedBefore()
    Set the path in the config using a rank
    Then to change you can just set it again
     
  3. Offline

    RustyDesigns

    I know that, just how do I do the config stuff? I assume that this is better than using a HashMap, right?
     
  4. Online

    timtower Administrator Administrator Moderator

    @RustyDesigns Well, you need to save the hashmap sometime, it depends on how much you use it.
    If you will get it a lot then you should use a hashmap.
     
  5. Offline

    RustyDesigns

    Ok, would it be possible on every reload to store the hash map into a config, to keep track of ranks?
     
  6. Offline

    RustyDesigns

  7. Online

    timtower Administrator Administrator Moderator

  8. Offline

    RustyDesigns

  9. Offline

    RustyDesigns

    @bwfcwalshy I have no idea what you are talking about....

    Its checking if the string assigned to the players uuid in the hash map is equal to mod.

    EDIT by Timtower: merged posts
     
  10. Offline

    PDKnight

    Post us your code.
    and line 16 as well
     
  11. Offline

    RustyDesigns

    Ok:
    Code:
            if (PermissionHandler.ranks.get(player.getUniqueId()).equals("Mod")) {
               
                event.setFormat(ChatColor.DARK_GRAY + "[" + ChatColor.YELLOW + "MOD"
                + ChatColor.DARK_GRAY + ":" + ChatColor.GRAY + event.getMessage());
               
            }
     
  12. Offline

    PDKnight

    @RustyDesigns Try to add this code before your if statement
    Code:java
    1. Bukkit.broadcastMessage(PermissionHandler.ranks+"; "+PermissionHandler.ranks.size());

    and tell us what it will print to server :)
     
  13. Offline

    RustyDesigns

  14. Moved to Bukkit Alternates.
     
  15. Offline

    RustyDesigns

    Ok, cool. Now, what do I do?
     
  16. Offline

    PDKnight

    Last edited: Aug 1, 2015
Thread Status:
Not open for further replies.

Share This Page