Solved Reports not showing up?

Discussion in 'Plugin Help/Development/Requests' started by football70500, Apr 17, 2015.

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

    football70500

    I have the permission to view reports but it seems like it has something to do with one of my checks before it actually sends the report message and i cant figure out which one. The message isnt being sent to anyone.

    Code:java
    1.  
    2. if (cmd.getName().equalsIgnoreCase("report")) {
    3. if (args.length > 1) {
    4. if (target != null) {
    5. if (sender.hasPermission("report.report")) {
    6. if (target != sender) {
    7. sender.sendMessage(ChatColor.GREEN
    8. + "Your report has been filed! Thank you.");
    9. for (Player online : Bukkit.getOnlinePlayers()) {
    10. if (online.hasPermission("hr.getmessage")) {
    11. online.sendMessage(ChatColor.BLUE
    12. + "[Report] " + ChatColor.YELLOW
    13. + sender2.getName() + ChatColor.RED
    14. + " has reported "
    15. + ChatColor.YELLOW
    16. + target.getName() + ChatColor.RED
    17. + " for " + ChatColor.GREEN
    18. + message);
    19. return true;
    20. }
    21. }
    22. } else {
    23. sender.sendMessage(ChatColor.RED
    24. + "You can't report yourself!");
    25. }
    26. } else {
    27. sender.sendMessage(ChatColor.RED
    28. + "You do not have permission to use /report!");
    29. }
    30. } else {
    31. sender.sendMessage(ChatColor.YELLOW
    32. + target.getDisplayName() + " is not online.");
    33.  
    34. return true;
    35. }
    36. } else {
    37. sender.sendMessage(ChatColor.RED + "/Report <Name> Message");
    38. return true;
    39.  
    40. }
    41. }
    42.  

    No errors are thrown. Is it my != sender?
     
  2. Offline

    ForsakenRealmz

    I'd say test removing the 'return true' on line 19. The way you have it set currently it's probably returning true after it checks the first online player. It says "Checking the first player... He has permissions... Sending message... Return true all done!"
     
  3. Offline

    football70500

    Thanks! It worked!
     
Thread Status:
Not open for further replies.

Share This Page