Plugin Help need help with some code

Discussion in 'Plugin Help/Development/Requests' started by yourmaster01, Oct 4, 2015.

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

    yourmaster01

    Hello i was hoping someone could help me out here. I want my plugin to reading multi lines from config and display them in pages like /help and /rules. i have it reading and displaying all of them at once but was hoping to get info on having them automatically get split into pages.
     
  2. Offline

    oceantheskatr

    Please post the code that you currently have. Either put it in [co de=java][/co de] (without the spaces in "code") tags or put it on http://pastebin.com/ and link the URL here.
     
  3. Offline

    yourmaster01

    this is me doing it by myself only adding 5 items in the list.
    Code:
    if (args.length == 0) {
          sender.sendMessage(ChatColor.GRAY + "-----------------------[" + ChatColor.AQUA + "1/2" + ChatColor.GRAY + "]-----------------------");
          List<String> banneditems = plugin.getConfig().getStringList("BannedItems.One");
          for (String s : banneditems) {
            sender.sendMessage(ChatColor.GRAY + " - " + ChatColor.AQUA + ChatColor.BOLD + s);
          }
          sender.sendMessage(ChatColor.GRAY + "----------------------------------------------------");
        }
    here is the config
    Code:
    BannedItems:
    #
      One:
      - Banned Item.
      - Banned Item.
      - Banned Item.
     
  4. Offline

    oceantheskatr

    What shows up in game?
     
  5. Offline

    timtower Administrator Administrator Moderator

    @yourmaster01 page = parsing(args[0])
    for(int i = <amountperpage>*page;i<(amountperpage*(page+1));i++){
    show(item i)
    }
     
  6. Offline

    yourmaster01

    right now
    @oceantheskatr
    it outputs
    - Banned item
    - Banned item
    - Banned item

    @timtower
    how do i use that exactly?
     
  7. Offline

    timtower Administrator Administrator Moderator

    @yourmaster01 Put it in the code instead of your current loop. Make sure to change the variables and functions though.
     
  8. Offline

    oceantheskatr

    I wanted to see a screenshot of how it looks in game :p
     
Thread Status:
Not open for further replies.

Share This Page