[Request] Run a command as an OP

Discussion in 'Archived: Plugin Requests' started by jojodmo, Sep 21, 2013.

  1. Offline

    jojodmo

    What I would like is pretty much a plugin in which you can run a command as an OP, for example, let's say that you cannot use the command /test in the console, only as a player. I would like it so that I could, with a command, have a NPC OP run /test, the reason /sudo jojodmo2010 test will not work is because, what if that player is not online. I would like to use this for BuyCraft, so that I can run a command which does not work in console as a NPC OP, I would have it do /sudo jojodmo2010 <command>, but what happens if I'm not online? The player would not receive what they bought. It shouldn't be an NPC, but just something that runs a command as an OP, and to control it, you should only be able to use the console. Thanks :D
     
  2. Offline

    MayoDwarf

    You are only allowed to bump every 24 hours...
     
  3. Offline

    jojodmo

    Whoopsiedoodles... Sorry, I didn't know that
     
  4. Offline

    Nuinbot

    Try CommandHelper.
     
  5. Offline

    jojodmo

    This helps just a tiny bit, but it doesn't allow me to run a command as an OP at all.
     
  6. Offline

    timtower Administrator Administrator Moderator

    Yes it does:
    Code:
    /opcommand = sudo('Any command you want to use here')
     
  7. Offline

    plantj0

    MyCMD or MyCommand fully supports this.
     
  8. Offline

    jojodmo


    No, that would run it as the console. Let me be clear - I want to be able to run a command as an opped player in the console.


    Doesn't allow you to run a command as an OP, though, only as the console.
     
  9. Offline

    timtower Administrator Administrator Moderator

    Quote from here: http://wiki.sk89q.com/wiki/CommandHelper/Staged/API/sudo
    runas can perform commands from console:
     
  10. Offline

    jojodmo


    So I could do something like this in my console.txt:

    Code:
    /cmanuaddall (.*) (.*)/ ==> ruans~op manuaddall $1 $2
    It really didn't explain it very well on the wiki. I would like this to be able to work in console.
     
  11. Offline

    timtower Administrator Administrator Moderator

    Commandhelper doesn't has an console.txt
     
  12. Offline

    jojodmo

    Oh sorry, I'm using commander, let me download that really fast and check it out.
     
  13. Offline

    Nuinbot

    Honestly, based on your original post, I would say you want to contact BuyCraft for help on this issue and not request a separate plugin just to make it work. You might want to check out Enjin too.
     
  14. Offline

    jojodmo

    This is what I'm going to use it mainly for, theres no doubt I'm going to use it for tons of other things, though

    Okay, great! My only problem is that now any user can run the command, I would like it to be only be able to be run as the console, or make them have to have a permission to run the command. If you can't do this i'll just change the command to something like /command-5XY781-GWSB-881GUIV3D or something like that.

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

    Nuinbot

    Don't give them the CommandHelper permissions. (In fact, if you have your perms set properly, you should be running as an admin, not op.) You can set up permissions per alias like this:

    Code:
    commandhelper.alias.<label>     #allow a player/group to use this alias
    -commandhelper.*     #deny anything else
    Check here for the CommandHelper permission settings.
     
  16. Offline

    jojodmo

    Got it. Yet for some reason this always returns 'world' where build, pvp, and kpvp are:
    Code:
    manuaddallpermission:/manuaddall $user $rank $world = runas('~op', /manuadd $user $rank spawn) \
        runas('~op', /manuadd $user $rank build) \
        runas('~op', /manuadd $user $rank PvP) \
            runas('~op', /manuadd $user $rank KPvP) \
    So basically, where spawn, build, pvp, and kpvp are, it desides to replace with 'world' so I get this:
    Code:
    jojodmo2010 was moved to group owner in world.
    jojodmo2010 was moved to group owner in world.
    jojodmo2010 was moved to group owner in world.
    jojodmo2010 was moved to group owner in world.
    when what should happen is this:
    Code:
    jojodmo2010 was moved to group owner in spawn.
    jojodmo2010 was moved to group owner in PvP.
    jojodmo2010 was moved to group owner in KPvP.
    jojodmo2010 was moved to group owner in build.
    I'm using the correct command in commandhelper... Any ideas?
     
  17. Offline

    timtower Administrator Administrator Moderator

    jojodmo2010 Try this code:
    Code:
    manuaddallpermission:/manuaddall $user $rank = >>>
      sudo(/manuadd $user $rank spawn)
      sudo(/manuadd $user $rank PvP)
      sudo(/manuadd $user $rank KPvP)
      sudo(/manuadd $user $rank build)
      msg('Player added')
    <<<
    Removed the world variable in the command
     
  18. Offline

    jojodmo

    Thanks, I think the <<< and >>> did it
     
    timtower likes this.

Share This Page