Making Console Run Sudo Commands

Discussion in 'Plugin Development' started by Dilmorak, Aug 10, 2013.

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

    Dilmorak

    I've been trying for a bit now, and whenever I try running a SUDO command using this code

    Code:java
    1.  
    2. String commandrun = "sudo " + player.getName() + this.getConfig().getString("COMMAND");
    3.  
    4. sender.getServer().dispatchCommand(player.getServer().getConsoleSender(), commandrun);
    5.  


    It comes up with this in the console when I run my command,

    Make another user perform a command.
    /sudo <player> <command [args]>

    Any help? Is this even possible?
     
  2. Offline

    Assist

    Dilmorak
    Make sure to add a space between player name and the actual command.
     
    Dilmorak likes this.
  3. Offline

    Dilmorak

    Thank you! It's always the little things, isn't it...
     
    Assist likes this.
Thread Status:
Not open for further replies.

Share This Page