Unable to have more than one kick reason string?

Discussion in 'Plugin Development' started by Axanite, Sep 11, 2013.

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

    Axanite

    So I'm trying to make a custom admin commands plugin, starting with /kick. I've got it working but the problem i'm running in to is I can't make it so you can do more than one word for the reason. I tried adding things that I found on the forums here but they either broke it or didn't even work without any errors. Any help will be greatly appreciated on this matter..

    Source: http://pastebin.com/A3fAMkbU
     
  2. Offline

    LegoPal92

    You are doing if args.length == 2. You should be doing if args.length >= 2. It is a different argument after every space.
     
  3. Offline

    uyuyuy99

    Code:java
    1. if(args.length == 2) {
    2. if(args.length < 2) {
    Take out this second "if" statement, and then do what LegoPal92 said. What you're doing here is checking to see if there are 2 arguments, and then only proceeding if there are less than 2 arguments, which makes no sense. You need to check if there are more than 2 arguments.
     
    Janmm14 likes this.
Thread Status:
Not open for further replies.

Share This Page