Odd arguments problem

Discussion in 'Plugin Development' started by ZaneBaney, May 8, 2014.

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

    ZaneBaney

    Hi there, I have just created a command for joining an arena and it has multiple arguments,
    (e.g /arena join blue).
    if (args[0].equalsIgnoreCase("join")) {
    This works fine it's the next check for the next argument that does not work.
    }
    Here is my code:
    Code:java
    1. if (args.length == 2) {
    2. if (args[0].equalsIgnoreCase("join")) {
    3. player.sendMessage("This works");
    4. if (args[1].equalsIgnoreCase("red")) { // <-- This does not work - Console says there is an error
    5. teamsClass.JoinTeamRed(player, null);
    6. }
    7. if (args[1].equalsIgnoreCase("blue")) {
    8. teamsClass.JoinTeamBlue(player, null);
    9.  
    10. }
     
  2. Offline

    tryy3

    Stacktrace when you try to run the command please!
     
Thread Status:
Not open for further replies.

Share This Page