Staff List

Discussion in 'Plugin Development' started by wildster29, Mar 30, 2020.

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

    wildster29

    Hi, I am trying to separate staff from my list into a different group and possibly separate ranks anyway you guys could give me a hand?

    My code is here
    https://pastebin.com/zXjFq1kF
     
  2. Offline

    CraftCreeper6

    @wildster29
    From what I can see you're missing an if statement in that code to check if the prefix is actually the staff prefix. You'd be better of making a custom permission for staff members and checking if they have that permission instead.
     
  3. Offline

    wildster29

    I just tried checking for a custom permission but I cant seem to get past it, I keep getting errors.

    Updated Code
    https://pastebin.com/shx5rAGe
     
  4. Offline

    CraftCreeper6

    @wildster29
    Code:
     if (online.hasPermission("rivals.staff"));
                    Staff.add(online);
                    {
    You should seriously consider some java tutorials before starting with Bukkit. That is not how you make an if statement.

    Code:
     if (online.hasPermission("rivals.staff"))
                    {
                    Staff.add(online);
    is how it should be.
     
    wildster29 likes this.
  5. Offline

    timtower Administrator Administrator Moderator

    @wildster29 Might help to have the Staff variable outside the loop as well.
     
    wildster29 likes this.
  6. Offline

    wildster29

    It worked Thank You, And I will consider some tutorials.
     
  7. Offline

    ZimrightPlugin

    May you can do it with a permission
    Code:
    for(Player players : Bukkit.getOnlinePlayers){
         if(players.hasPermission('stuff'){
            doSomething
         }
    }
    I already made a plugin like this

    My plugin on dev.bukkit.org
     
Thread Status:
Not open for further replies.

Share This Page