runas/sudo command - still different

Discussion in 'Archived: Plugin Requests' started by xxldoener, May 31, 2013.

  1. Offline

    xxldoener

    Hey guys, I am already using Essentials and I really love the "sudo" command which enables you to run a command as another player. However, one thing that bugs me is that you can not run commands the player has no permission to. So for example if a player gets stuck in a cave and I decide to rescue him using the "ascend" command, I always have to do "op PLAYER, sudo PLAYER ascend, deop PLAYER" which I am really not comfortable with since they could run other commands as an op while they have that permission.

    So what I want is something like a "/sudoop PLAYER COMMAND" which makes a player run a command as if he would be opped, but only for that command.

    If that is too complicated, a version where the command ops the player, runs the command and deops him automatically afterwards would be enough, since I dont think that a player could run a command in such a short time, but the first one where the player doesnt even have to be oped would be nicer :)

    I hope you like my idea and I would love to see such a plugin.
    Cheers :)
     
  2. Offline

    Magic_Mat

    Seems pretty simple, ill make this as soon as I finish my lunch ;)
    The easiest way would be do to
    player.setop(true)
    //run command stuff here
    player.setop(false)

    There would be a very short time when the layer was op (less than a second) and I'm pretty sure the way bukkit processes commands, it waits until the previous one has finished, then runs the next one, so it would be near impossible to preform a command as an op
     
  3. Offline

    xxldoener

    Thanks a lot for taking the time :) I thought that this would be the easiest solution to do this. As we both said, it should not be possible to run a command in that short ammount of time. The only thing I don't like about the second solution is that there will always be the message "You are now OP, you are no longer OP". Can you disable that somehow?
     
  4. Offline

    Magic_Mat

    The "you are now op" and "you are no longer op" message will not be shown, that is only when you make them an op through the default command, and not through the bukkit api
     
  5. Offline

    xxldoener

    Ah ok, that is nice to hear. Just build the plugin whenever you feel like it. Within the next week would be nice but the earlier the better :)
     

Share This Page