Solved Setting command executer rank.

Discussion in 'Plugin Development' started by Nebuler, Apr 1, 2016.

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

    Nebuler

    My code:
    Code:
    if (args.length == 1){
                    if (args[0].equalsIgnoreCase("Citizen")){
                        sender.sendMessage("You have successfully ranked up to Citizen!");
                        getServer().dispatchCommand(getServer().getConsoleSender(), "pex user" + name + ("group set") + args[0]);
                    }
    I'm trying to set the command executer's rank to the first argument. I get a pex error: Error in command syntax: check command help. Clearly the command I'm trying to execute is /pex user playername group set firstarg and I'm puzzled as to how I've got the syntax incorrect.

    EDIT: Self solved, I didn't add spaces, I was sending /pex userusernamegroup setarg0
    New code:
    Code:
    if (args[0].equalsIgnoreCase("Citizen")){
                        sender.sendMessage("You have successfully ranked up to Citizen!");
                        getServer().dispatchCommand(getServer().getConsoleSender(), "pex user " + name + (" group set ") + args[0]);
                    }
     
    Last edited: Apr 1, 2016
Thread Status:
Not open for further replies.

Share This Page