Filled Big Plugin Request, i guess? {pExtras}.

Discussion in 'Plugin Requests' started by Syrianen, Jul 7, 2015.

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

    Syrianen

    Suggested name: pExtras

    What I want: So I need some extra commands/functions for a server. Most of them are for the chat and management.
    I know that this is alot and not so simple and it will take time. But I will really appreciate it if someone could create this plugin for me!

    Everything like amount of lines to clear when using /clearchat. Check configuration section.
    Messages and prefixes also needs to be configurable. Like when notified of a report or pbroadcast.
    EEEVVVRYYTHING NEEDS TO BE CONFIGURABLE, EVEN LANGUAGE/MESSAGES!


    Commands:
    - /clearchat - Clears chat. Alias: /cc.
    - /mutechat - Toggles chat Alias: /mc.
    - /staffchat <message> - Sends a message in the staff channel. Alias: /sc <message>.
    - /oplist - Shows a list of all operators on the server.
    - /pbroadcast <message> - Broadcasts a message in the server chat. Alias: /pbc <message>.
    - /report <player> <reason> - Reports a player (Sends a notification in chat to player with the permission 'pextras.report.notify'.
    - /itemname - Sets a name for the item.
    - /itemlore - Sets a lore for the item.
    - /disenchant - Removes all the enchantments from an item.
    - /setwhitelistmessage <message> - Sets the whitelist message. Alias: /setwm <message>
    - /titlealert <message> - Sends an alert in titlebar (Subtitle will be sepereated with '\').


    Permissions:
    pextras.clearchat - Permission to use /clearchat.
    pextras.mutechat.mute - Permission to use /mutechat.
    pextras.mutechat.bypass - Can talk when chat is muted.
    pextras.staffchat - Permission to read and speak in the staffchat (/staffchat <message>).
    pextras.oplist - Permission to use /oplist.
    pextras.pbroadcast - Permission to use /pbroadcast.
    pextras.report.use - Permission to report a player (/report <player <reason>).
    pextras.report.notify - Permission to be notified whenever someone gets reported.
    pextras.itemname - Permission to use /itemname.
    pextras.itemlore - Permission to use /itemlore.
    pextras.disenchant - Permission to use /disenchant
    pextras.setwhitelistmessage - Permission to use /
    pextras.titlealert - Permission to use /titlealert <message>.


    When I'd like it by:
    Take your time! Cause i think that this is a really big plugin but I don't know who experienced you are with coding and what not, so take your time!

    Sorry if you don't understand some things, I do not speak english fluently.
     
    Last edited: Jul 8, 2015
  2. Offline

    JoloCodeBrahs

    Seems a bit asky.
     
  3. Offline

    pie_flavor

    @Syrianen Your english is better than that of a hell of a lot of people here. I honestly couldn't tell. And I can make this.
    Does the whitelist message need to persist between server restarts?
     
    Last edited: Jul 7, 2015
  4. Offline

    Syrianen

    Yes please! @pie_flavor

    @JoloCodeBrahs
    I know....
     
  5. Offline

    DoggyCode™

    Umm.. I could make this.

    Edit: Nvm, I don't know how to just clear a amount of lines..

    @Syrianen
     
    Last edited: Jul 8, 2015
  6. Offline

    Alkerti

    Wouldn't you just create a bunch of empty chat lines?
     
  7. @Syrianen You can do some of this with SOS and I will be adding some things like /report and to it at a later date.
     
  8. Offline

    Syrianen

    @bwfcwalshy SOS has two of my requested features.
    And all the other features will they override essentials?
     
  9. Offline

    DoggyCode™

    Oh, yeh xD but it would look something like this:

    Code:
        if(cmd.getName().equalsIgnoreCase("clearchat")) {
           if(args.length == 0) {
             sender.sendMessage("Specify a amount of lines");
             return true;
           } else if(args.length == 1) {
             int line = Integer.parseInt(args[0]);
             if(line == 1) {
               Bukkit.broadcastMessage("  ");
             } else if(line == 2) {
               Bukkit.broadcastMessage("  ");
               Bukkit.broadcastMessage("  ");
             } else if(line == 3) {
               Bukkit.broadcastMessage("  ");
               Bukkit.broadcastMessage("  ");
               Bukkit.broadcastMessage("  ");
             } else if(line == 4) {
               Bukkit.broadcastMessage("  ");
               Bukkit.broadcastMessage("  ");
               Bukkit.broadcastMessage("  ");
               Bukkit.broadcastMessage("  ");
             } else if(line == 5) {
               Bukkit.broadcastMessage("  ");
               Bukkit.broadcastMessage("  ");
               Bukkit.broadcastMessage("  ");
               Bukkit.broadcastMessage("  ");
               Bukkit.broadcastMessage("  ");
             } //and so on
           }
         }
    and if you for example want that up to 100... then it would be a bit exhausting.. 10 or 20 lines could be fine, but I'm not sure that clears the whole chat.

    @Alkerti
     
  10. @DoggyCode™ @Alkerti A clear chat is super easy to write.

    Code:
    for(int i = 0; i < 100; i++){
      Bukkit.broadcastMessage(" ");
    }
    And loop through players if you don't want a broadcast (The issue with broadcasts are that they also send to console)

    @Syrianen If you don't want them to overwrite Essentials then just make Essentials enable after SOS.
     
  11. Offline

    DoggyCode™

    So if you do that, it will basically write "Bukkit.broadcastMessage(" ");" the specified amount of times? So like this?

    Code:
    if(cmd.getName().equalsIgnoreCase("clearchat")) {
           if(args.length == 0) {
             sender.sendMessage("Specify a amount of lines");
             return true;
           } else if(args.length == 1) {
             int line = Integer.parseInt(args[0]);
             for(int i = 0; line < 100; i++){
    Bukkit.broadcastMessage(" ");
    
    }
    }
    }
    
    @bwfcwalshy
     
  12. @DoggyCode™ Replace the 100 with line and keep i where it was. But yes that will work. I would also do a try catch on the parse.
     
  13. Offline

    DoggyCode™

    Haha! I didn't know that, which is why I love being around on the Bukkit forums, learning new things all the time.

    @bwfcwalshy

    Code:
        if(cmd.getName().equalsIgnoreCase("clearchat")) {
           if(args.length == 0) {
             for(int i = 0; i < 100; i++) {
               Bukkit.broadcastMessage("  ");
             }
             Bukkit.broadcastMessage(ChatColor.BLUE + "The chat has been cleared by " + ChatColor.RED + sender.getName());
           } else if(args.length == 1) {
             int line = Integer.parseInt(args[0]);
             if(line != 0) {
               for(int i = 0; i < line; i++) {
                 Bukkit.broadcastMessage("  ");
               }
               Bukkit.broadcastMessage(ChatColor.BLUE + "The chat has been cleared by " + ChatColor.RED + sender.getName());
             } else {
               sender.sendMessage(ChatColor.RED + "An integer with the value higher than 0 has to be specified");
             }
           }
         }
    
    Works perfect! Thanks man.

    Another thing though.. how to I check if the argument specified is a integer or not? Because I want to say, if it is not, then it will send a message saying "You have to specify an integer". And how to you check if the sender specified a comma/dot or not?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
    Ruptur and bwfcwalshy like this.
  14. Offline

    Ruptur

    @DoggyCode™
    You parse the string in a try-catch block. You will need to catch NumberFormatException meaning that what they entered wasnt valid.
    An example on how this can be achieved:
    Code:
    String number = args[n];
    int parsed;
    try {
        parsed = Integer.parse(number);
    catch (NumberFormatException ignored) {
        // the entered number isnt valid
        return;
    }
    
    // do something with parsed
    
     
  15. Offline

    DoggyCode™

    Can you say exactly how I can use this is my code?

    @Ruptur

    My code:

    Code:
        if(cmd.getName().equalsIgnoreCase("clearchat")) {
           if(args.length == 0) {
             for(int i = 0; i < 100; i++) {
               Bukkit.broadcastMessage("  ");
             }
             Bukkit.broadcastMessage(ChatColor.BLUE + "The chat has been cleared by " + ChatColor.RED + sender.getName());
           } else if(args.length == 1) {
             int line = Integer.parseInt(args[0]);
             if(line != 0) {
               for(int i = 0; i < line; i++) {
                 Bukkit.broadcastMessage("  ");
               }
               Bukkit.broadcastMessage(ChatColor.BLUE + "The chat has been cleared by " + ChatColor.RED + sender.getName());
             } else {
               sender.sendMessage(ChatColor.RED + "An integer with the value higher than 0 has to be specified");
             }
           }
         }
    
     
  16. Offline

    Syrianen

    If you have any more questions on clearchat or how to code clear chat or what ever you want except about this thread please take that in some other sub-forum. This is a plugin request...
     
  17. Offline

    Syrianen

  18. Offline

    poepdrolify

    @DoggyCode™ Create a scheduler and then cancel it after x amount of times...

    I can start on this plugin

    EDIT by Timtower: merged posts
     
    Last edited by a moderator: Jul 10, 2015
  19. Offline

    Syrianen

    Yes please!
     
  20. Offline

    flash1110

  21. Offline

    Syrianen

  22. Offline

    flash1110

    No problem, just taking a bit to get approved. ahah
     
Thread Status:
Not open for further replies.

Share This Page