Groupmanager Help!

Discussion in 'Plugin Development' started by rob1998@, Jun 18, 2013.

Thread Status:
Not open for further replies.
  1. How can I change someone's Groupmanager group with a command like /join [groupname]
    I want that players can change there groups, I've linked the Groupmanager jar to my project and I've looked at the examples but I still don't know how to do it...
    Can someone please explain me?
     
  2. Offline

    MCForger

    rob1998@
    Why not when they run the command take certain arguments from your command and make it run one of the plugins commands it knows to finish the task?
     
  3. You meen something like an alias command?
    because I want separate permission.
    If needed I will use Vault api instead of group manager, but I don't get it with Vault either
     
  4. Offline

    MCForger

    rob1998@
    You can make your command have its own permission and such. Lets say I wanted to promote me to admin through my command which is "/join admin". Well then after type that command and I have that permission your plugin will type a command in the console like /groupmanager promote (username) (group) and execute it.
     
  5. ok and can you explain me how to do that? I haven't made any new plugin since December 2012...
    just explain me how I get the args from my command to the command that will be sent to the console.
    and how I sent a command to the console
     
  6. Offline

    MCForger

    rob1998@
    You would use this format to execute the command from console.
    Server.dispatchCommand(Bukkit.getConsoleSender(),<Your command String>);
    Assuming your command is still "/join (groupname)" you would do args[0] and say that is my group name then pass the command to dispatch:
    Server.dispatchCommand(Bukkit.getConsoleSender(),"/groupmanager add " + sender.getName() + " " + args[0]);
     
  7. when i type the command it works but as respond I get the usage.. (when I type /join Builder it responds /join [group] that's what I filled in the plugin.yml)
    is it possible to respond "Joined successfully" or "Something wend wrong, please contact a Admin" ?
     
  8. Offline

    LucasEmanuel

    It's probably better to use player.performCommand(" command "); so that the player isn't able to go around the permission check for the original command.

    EDIT: Oh my bad, didn't realise that the command used to manage groups was an OP-command ;)
     
Thread Status:
Not open for further replies.

Share This Page