Scoreboard Prefix Buggt! Extrem

Discussion in 'Spigot Plugin Development' started by zChwis, Apr 28, 2017.

  1. CODE:
    https://hastebin.com/muqadadiva.java

    Erklärungs Fehler:
    Für z.b. einem Admin werden alle als admin angezeigt(gesetzt), ein andere spieler mit der gruppe Dev bei desem werden alle andren als Dev angezeigt, kann mir jemand sagen warum und wie ich das anders machen soll?? bzw, einen lösungs code sicken?

    LG
    Chris
     
  2. Deutsch: Beschreib dein Problem am besten auf Englisch damit alle es verstehen
    English: Write your issue on english so everyone is able to understand what you are searching for

    Continuing with your question on english..

    First of, you won't get a complete fixed source code in that size that's what we call spoonfeed.
    Your reason for that is because you add everyone to the specific team at this line:

    Code (Text):

         Admin.setPrefix("§4§lAdmin §7");
                    Admin.addPlayer(all);
     
    So why is this beeing executed?

    Here are full line of codes that produce your issue

    Code (Text):

    for (Player all : Bukkit.getOnlinePlayers()) {
                if (PermissionsEx.getUser(name).inGroup("Owner")) {
                    Owner.setPrefix("§4§lOwner §7");
                    Owner.addPlayer(all);
                }
    }
     
    So you first check if the user with Name "name" is in group "Owner" but when that happens, you just add everyone to the team, you can fix that by removing "name" and replacing that with "all.getName()"
     
  3. Thank you, I've really desperate.