Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Problem] Gildie pytanie


Rekomendowane odpowiedzi

Opublikowano

Witam zakupiłem pewny plugin gildie wszystko działa itp ale mam 2 problemy
jeden jak wpisze /g info to wszystko działa a jak założe sojusz i wpisze /g info wysakuje
An internal error occureed while attempting to perform this command
kawałek klasy odpowiadający za to 

Kod (java):
  1.  
  2. String mistrzowieString = sbMistrzowie.toString();
  3. if (gildia.getMistrzowie().size() == 0) {
  4. mistrzowieString = this.plugin.messageManager.infoNone;
  5. }
  6. for (String s : this.plugin.messageManager.infoMsg) {
  7. = s.replace("%tag%", gildia.getTag());
  8. = s.replace("%name%", gildia.getName());
  9. = s.replace("%position%"Integer.toString(Datasource.getGuildPostionByTag(gildia.getTag())));
  10. = s.replace("%points%"Integer.toString(gildia.getPunkty()));
  11. = s.replace("%lider%", gildia.getLider());
  12. = s.replace("%kills%"Integer.toString(gildia.getZabicia()));
  13. = s.replace("%deaths%"Integer.toString(gildia.getZgony()));
  14. = s.replace("%kdr%"Double.toString(kdr));
  15. = s.replace("%size%"Double.toString(rozmiar));
  16. = s.replace("%sizemembers%"Integer.toString(gildia.getCzlonkowie().size()));
  17. = s.replace("%maxMembers%"Integer.toString(gildia.getMaxCzlonkow()));
  18. = s.replace("%online%"Integer.toString(online));
  19. = s.replace("%members%", onlineString);
  20. = s.replace("%masters%", mistrzowieString);
  21. for (int i = 0; i <= this.plugin.configManager.guildSojuszMax; i++)
  22. {
  23. if ((gildia.getSojusze().size() <= i) && (gildia.getSojusze().size() > 0))
  24. {
  25. DataGuild sojusz = this.plugin.data.getGuildByTag((String)gildia.getSojusze().get(- 1));
  26. if (sojusz != null)
  27. = s.replace("%alliance" + i + "%"this.plugin.messageManager.infoAlliances.replace("%tag%", sojusz.getTag()).replace("%name%", sojusz.getName()));
  28. else {
  29. = s.replace("%alliance" + i + "%"this.plugin.messageManager.infoAlliances.replace("%tag%""").replace("%name%"""));
  30. }
  31. }
  32. else if (== 1) {
  33. = s.replace("%alliance" + i + "%"this.plugin.messageManager.infoNone);
  34. } else {
  35. = s.replace("%alliance" + i + "%""");
  36. }
  37. }
  38. if ((s.split("").length != 1) && (s.split("").length != 2) && (s.split("").length != 3))
  39. p.sendMessage(this.plugin.fixMsg(s));
  40. }
  41. }
  42.  

zauwazyłem ze jak wyrzuce to z plugin all działała ale znów pod /g info nie pokazuje sojuszów;/

Kod (java):
  1.  
  2. if ((gildia.getSojusze().size() <= i) && (gildia.getSojusze().size() > 0))
  3. {
  4. DataGuild sojusz = this.plugin.data.getGuildByTag((String)gildia.getSojusze().get(- 1));
  5. if (sojusz != null)
  6. = s.replace("%alliance" + i + "%"this.plugin.messageManager.infoAlliances.replace("%tag%", sojusz.getTag()).replace("%name%", sojusz.getName()));
  7. else {
  8. = s.replace("%alliance" + i + "%"this.plugin.messageManager.infoAlliances.replace("%tag%""").replace("%name%"""));
  9. }
  10. }
  11. else if (== 1) {
  12. = s.replace("%alliance" + i + "%"this.plugin.messageManager.infoNone);
  13. } else {
  14. = s.replace("%alliance" + i + "%""");
  15. }
  16. }
  17. if ((s.split("").length != 1) && (s.split("").length != 2) && (s.split("").length != 3))
  18. p.sendMessage(this.plugin.fixMsg(s));
  19. }
  20. }
  21.  

to jest mój pierwszy problem a 2 jest tkai
ze jak gracz jest online to nie mozna wyrzucic gracza z gildi
czesc kodu odpowiedająca za kick z gildi

Kod (java):
  1.  
  2. else if (args[0].equalsIgnoreCase(this.plugin.messageManager.kickCommand)) {
  3. if (args.length != 2) {
  4. sender.sendMessage(this.plugin.fixMsg(this.plugin.messageManager.kickCorrectUsage));
  5. return true;
  6. }
  7. final Player p = (Player)sender;
  8. final DataGuildUser user3 = this.plugin.data.getUserByPlayer(p);
  9. final Player other2 = Bukkit.getPlayerExact(args[1]);
  10. final DataGuildUser userOther2 = this.plugin.data.getUserByPlayer(other2);
  11. if (user3.equals(userOther2)) {
  12. sender.sendMessage(this.plugin.fixMsg(this.plugin.messageManager.kickIsOther));
  13. return true;
  14. }
  15. if (!user3.getTag().toLowerCase().equals(userOther2.getTag().toLowerCase())) {
  16. sender.sendMessage(this.plugin.fixMsg(this.plugin.messageManager.kickIsNoGuild));
  17. return true;
  18. }
  19. if (user3.getRanga() < 2) {
  20. sender.sendMessage(this.plugin.fixMsg(this.plugin.messageManager.kickIsNoMistrz));
  21. return true;
  22. }
  23. if (userOther2.getRanga() > 1) {
  24. sender.sendMessage(this.plugin.fixMsg(this.plugin.messageManager.kickIsMistrz));
  25. return true;
  26. }
  27. final DataGuild gildia6 = this.plugin.data.getGuildByTag(userOther2.getTag());
  28. final DataGuildUser ranking2 = this.plugin.data.getUserByPlayer(p);
  29. gildia6.setPunkty(gildia6.getPunkty() - ranking2.getPoints());
  30. gildia6.setZabicia(gildia6.getZabicia() - ranking2.getKills());
  31. gildia6.setZgony(gildia6.getZgony() - ranking2.getDeaths());
  32. gildia6.removeCzlonkowie(other2.getName());
  33. gildia6.removeMistrzowie(other2.getName());
  34. gildia6.update();
  35. userOther2.setTag("");
  36. userOther2.setNazwa("");
  37. userOther2.setRanga(0);
  38. userOther2.update();
  39. Bukkit.broadcastMessage(this.plugin.fixMsg(this.plugin.messageManager.kickKick).replace("%player%", other2.getName()).replace("%tag%", gildia6.getTag()).replace("%name%", gildia6.getName()).replace("%kicker%", p.getName()));
  40. Player[] onlinePlayers5;
  41. for (int length5 = (onlinePlayers5 = (Player[]) Bukkit.getOfflinePlayers()).length, n2 = 0; n2 < length5; ++n2) {
  42. final Player online2 = onlinePlayers5[n2];
  43. UserJoinLeaveListener.refresh(online2);
  44. }
  45. }
  46.  

czy moze mi tkos powiedziec co zmienić w tym żeby gracz offline tez mógłby być kikowany?

Co ja tutaj robie...

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...