Group Command

Intro:

Do you need one command that can do multiple different things for different permission groups?
I certainly did, but was unable to find any plugin that could do that, so I decided to create my very own.

Group Command will allow users to run a single command and have different things happen depending on their permission group. All the commands are run from /gcmd <subcommand> with the sub command being defined in the config.yml.

Purpose:

So what on earth would you ever use something like this for? Well, there were two very specific issues I ran into on the server I run which were both solved with this plugin.

We had been using another plugin to automatically reward people that referred other players to the server, but wanted to add a special rank as a reward. Group Command allowed us to set the referral plugin to run a command defined in the config to promote users that were below that rank (members, for example) but not "promote" the higher ranks like vip, and to instead give them some items.
Another use was to automate vip rank upgrades from buycraft. Upon buying the appropriate package, buycraft would run a group command set and promote the user up by one rank.

It runs the desired command from the console as well, so it could be useful for giving users access to a specific form of a command instead of the whole command (like the example below where noobs and builders can kick themselves, but not others).

Usage:

Upon first loading, the plugin will generate a default config.yml in it's subfolder inside the plugins folder with the following:

#Config layout:
#
#subcommand:
#  set1:
#    groups:
#      - group1
#      - group2
#    commands:
#      - somecommand
#      - somecommand
#
# Commands are run like: /gcmd <subcommand>
#
# Below is a sample command group that will kick noobs that think they 
# can op themselves but will actually op staff groups.
#
# Note that @p will be replaced by the player executing the command 
# unless otherwise specified by a player with op (or the console).
#
# /gcmd list will list all the sub commands available

op:
  set1:
    groups:
      - noob
      - builder
    commands: 
      - kick @p You can't op yourself idiot!
  set2:
    groups:
      - owner
      - admin
    commands: 
      - op @p

You can add as many sub commands, sets, groups, and commands as you want, so long as you keep the format the same, they should work fine.
All the commands set in 'commands:' will be run if the player (either specifically defined, or running the command if no player is specified) is in any of the groups listed in 'groups' for the corresponding set. Sets and sub commands can be named whatever you want.

Commands:

/gcmd <subcommand> [player] - runs the sub command defined in the config. Player can only be defined by the console, or an OP.
/gcreload - reloads commands from the config.

Permissions:

groupcommand.gcmd - grants access to the /gcmd command
groupcommand.reload - grants access to /gcreload to load changes to the config

Dependencies:

Vault so it can read a player's group.


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files