Sudo command overriding permissions.

Discussion in 'Archived: Plugin Requests' started by AdamN, Feb 11, 2014.

  1. Offline


    Hello, I'm looking for a plugin that will allow the
    /sudo [playername] [command]
    command to be used on any player using any command, completely overriding that players pemissions...

    For example, AdamN is in the group "default" and is not op'd.
    The group "default" only has 1 permission; "sudo.override". (PEX)
    Now, as the console or as an op, I can use the command
    /sudo AdamN warp spawn
    /sudo AdamN op AdamM
    and have these commands work as if AdamN had permission to use these commands.

    Most importantly this also needs to function with command blocks. (@p ect.)

    I understand that this is probably really simple and a plugin that does this might already exist... It might even be as simple as changing something in a config and not even require a new plugin. If so please say so.
  2. Offline


    You can just do /op adamN or /warp adamN spawn
  3. Offline

    timtower Administrator Administrator Moderator

    Set op, run command, stop command
  4. timtower
    Yea that should work out thanks :)
    timtower likes this.
  5. Offline


    I wasn't asking specifically for those commands, I was using them as examples. An actual commands I want to run via command blocks:
    /sudo @p[r=5] echo Welcome to my shop!
    This way it removes the horrible [CONSOLE -> ME] Welecome to my shop!
    Again, not the only command I want to run so don't go saying "give the player permission to do /echo" that doesn't accomplish anything.

    Could that not get abused if players were fast enough/server lags?
  6. Offline

    timtower Administrator Administrator Moderator

    It is all happening at the same time so doubt it, you need to type 2 commands incredibly fast after each other for it to work, only way to do that is with macro's if that even works
  7. Offline


    Alright, so are you making a plugin that can do this or just offering advice to whoever does?
    Or are you suggesting I op and deop players via command blocks... Because that is very easily abused because the whole range dealio.
  8. Offline

    timtower Administrator Administrator Moderator

    Just offering advice to any dev that wants to make this. And don't do this with commandblocks, really unsafe, then you would be better of using an alias plugin.

    Btw: to the dev that will make this: do make sure to restore OP status if the player was OP already
  9. Offline


    timtower How do you code something to run a command? (This may be an easy skill, I just haven't come across a solution)
  10. Offline

    timtower Administrator Administrator Moderator

    Command is without the /commandsender is either the console or a player
    TopTobster5 likes this.
  11. Offline


    OK thanks, I'll give the plugin a go.
    timtower likes this.
  12. Offline


    TopTobster5 I don't need this plugin urgently anymore, I've found a way around needing it by using this plugin:
    to charge people to access a command that seems to override their permissions.
    Previously I was charging people to press a button which would then activate command blocks.

    However this plugin is a little buggy and I'd much prefer to use command blocks, so if you can make it by all means, but take as long as you want :p.
  13. Offline


    AdamN OK, it shouldn't take too long to complete it, I have written most of it already.

    AdamN I have finished the plugin except for one bug, which I cannot work out what is causing it. It is not major, and it should still work normally. Here is a link to download it:
    There is no config file or anything like that. The only permission is sudoop.sudo which allows you to use the /sudo command.

    The /sudo command requires 2 arguments and is used as so: /sudo [playername] [command]

    The bug happens when someone uses the command but that person is not online. There is an error in the console, but everything still works after that. As you want it for command blocks, this should not be a problem. I'll keep working on a fix to the bug.

    The plugin also works with command blocks, I have tested it.

    That's about all you need to know. Message me if you have a problem. :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 6, 2016

Share This Page