Scoreboard only for admins

Discussion in 'Spigot Plugin Development' started by Apexectr, Jul 14, 2015.

  1. Hey Guys, I have a problem... I want to make a scoreboard (Type: BELOW_NAME) that is only set for admins (p.isOp()). What I mean is:

    Default Player = Nope
    Admin = [Server Admin] below name

    Example: [​IMG]
    This player is not a admin... That's what I mean. :/
    So, how should I do it now? Thanks :)
     
  2. Can we see your code?... We can't help you unless we see where you went wrong.
     
  3. You are displaying it to everyone, and also putting the message below everyone's head. You will see that above everyone's head if you are an OP, but see it above no one's head as a player.
     
  4. So...?? (Code?)
     
  5. I'm not going to feed you code. Try to look into teams in the JavaDoc
     
    • Agree Agree x 2
  6. reverse it
     
    • Agree Agree x 1
  7. Learn how to code in java.
    Simple!
    I highly suspect you of coping and pasting code since you clearly have no idea how to use an if/else statement.
     
    • Agree Agree x 1
  8. Dude... I program already 1 year, am neither a Kiddie still a noob in Java. I only have no idea how to do that! Alright?! :confused::(
     
  9. ▬ Thread Closed ▬ I will ask my friend. You guys are unfair and hopeless.
     
  10. HTML:

    if(!player.isOp() {
     return;
    }
     
    Put that above your scoreboard code! :)
     
  11. Use for(Player all: Bukkit.getOnlinePlayers()) { //Get the online players
    if(all.hasPermission("YourPerms") {
    //YOUR CODE HERE (set the admins scoreboard)
    }
    }

    I hope i could help
     
  12. Use for(Player all: Bukkit.getOnlinePlayers()) { //Get the online players
    if(all.hasPermission("YourPerms") {
    //YOUR CODE HERE (set the admins scoreboard)
    }
    }

    I hope i could help

    PS: MrCodex is my secondary Account :)
     
  13. Yes, you must use a API but i didn't no where
     
  14. Have you thought about changing the Op names with the suffix or preffix [SuperAdmin] on join instead of using a scoreboard? I think it will be easier.
     
  15. Yes, your right but you can't user the void setDisplayName thats not Working