Solved Arguments Help

Discussion in 'Plugin Development' started by moe097, Nov 27, 2014.

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

    moe097

    I am trying to make a plugin where the player types a directory on there computer (This is for windows) in a command like this:
    /AutoBackup Directory <Exact Directory>

    I don't know how to get the <Exact Directory> that the player enters.
    This is what I have so far:
    Code:java
    1. String directory = "";
    2. if(args[1].equalsIgnoreCase(directory) && directory != null) {
    3. player.sendMessage(ChatColor.GREEN + "You have set your server files directory to: " + directory);
    4. }


    Pastebin: http://pastebin.com/VtwpkqrU

    I get no error when I do the command, it just doesn't do anything.

    I have the other arguments written out already, this is the only part i'm confused on.
    I want to store the directory that the player enters as a variable.

    Thanks!
     
  2. Offline

    WesJD

  3. Offline

    moe097

    WesJD
    Yes, thats what I am trying to figure out. I have the other arguments of the command written.
     
  4. Offline

    WesJD

    moe097
    If it's in a config, get the string in the config and see if it's args[1]
     
  5. Offline

    teej107

  6. Offline

    moe097

    WesJD
    Okay I got it now. Thanks.

    teej107
    I know I was going to create an actual program to go along with this. Its not just a single plugin. Thanks for the reply though.
     
Thread Status:
Not open for further replies.

Share This Page