Skip to content

Limitgroups information and examples

Thijs Wiefferink edited this page Aug 3, 2017 · 7 revisions

General information

I recommend first reading the bullet list below to get an idea about the system, after that go to the Prison setup section if you are using it for prison, and otherwise follow the Multiworld setup, this explains the basic concepts and should adaptable to your situation.

The general concept of the limitGroups section in the config:

  • Basically each limit group you create will set certain upper limits to how much regions a player can have for regions in that group. If you don't have a groups: or worlds: section then this limit is about all regions registered in AreaShop.
  • limitgroups are a different thing as regiongroups, the first one can be found in the config and force certain maximum number of region a player can rent/buy, and the regiongroups are to group regions so that you can apply certain settings to it (regiongroups are made by using the /as groupadd <group> [region] and /as groupdel <group> [region] commands, if you don't specify a region it will take all regions it can find in your WorldEdit selection, that way it is easier to add a lot of them)
  • With the worlds section you can change the set of regions the limit is about, if you add 1 world the limit will only be about regions in that world, with 2 worlds it will be about regions that are in the first or second world.
  • You can do the same thing with groups as with worlds, if you have 1 group it will only be about regions in that group, with 2 it will be about regions in one or the other.
  • When a player tries to rent/buy a region AreaShop will check if ALL limitgroups that are assigned to the player by a permission (areashop.limits.), only if all limitgroups allow an extra region to be added then the transaction continues.
  • One important part: If a player has 2 limitgroups assigned to him that are limiting the same subset of regions (groups section is the same and worlds section is the same) then the highest limits are taken from the groups (if group1 has a higher total limit then it takes that, if group2 has a higher rent limit it takes that one with it). So if you give VIP's a certain group with higher limits then the permissions for default players do no interfere with that.

Rank based limits

The setup we want to create

  • Rank default can buy 1 region
  • Rank VIP can buy 3 regions

Setup of limit groups in the config.yml file

limitGroups:
  default:
    total: 1
    rents: 0
    buys: 1
  vip:
    total: 3
    rents: 0
    buys: 3

Permissions setup

Use your permissions plugin to give the areashop.limits.vip permission to the VIP rank. Everyone already has areashop.limits.default, which assigns that group.

Multiworld setup

The setup we want to achieve

Creative world (called creative_world):

  • 2 buy plots per player

Survival world (called survival_world):

  • 1 rent shop per player
  • 2 buy build plots per player

Next to that we want VIP's to have double limits for all of the above things.

Groups setup

Add all shops in survival to the group called shops:

  • Make a selection intersecting all shop regions
  • Use the following command: /as groupadd shops

Add all build plots in survival to the group called plots:

  • Make a selection intersecting all build plot regions
  • Use the following command: /as groupadd plots

You can of course repeat steps 1 and 2 until you have all regions added, you can also specify a region name as an extra argument to the command to add only that region.

Setup of limit groups in the config.yml file

limitGroups:
  default:
    total: 5
    rents: 1
    buys: 4
  creative:
    total: 2
    rents: 0
    buys: 2
    worlds:
    - 'creative_world'
  survivalshops:
    total: 1
    rents: 1
    buys: 0
    worlds:
    - 'survival_world'
    groups:
    - shops
  survivalplots:
    total: 2
    rents: 0
    buys: 2
    worlds:
    - 'survival_world'
    groups:
    - 'plots'
  vipdefault:
    total: 10
    rents: 2
    buys: 8
  vipcreative:
    total: 4
    rents: 0
    buys: 4
    worlds:
    - 'creative_world'
  vipsurvivalshops:
    total: 2
    rents: 2
    buys: 0
    worlds:
    - 'survival_world'
    groups:
    - 'shops'
  vipsurvivalplots:
    total: 4
    rents: 0
    buys: 4
    worlds:
    - 'survival_world'
    groups:
    - 'plots'

Permissions setup

Use your permissions plugin to give the correct permissions to certain players as listed below.

Permissions to give to normal players:

  • areashop.limits.creative
  • areashop.limits.survivalplots
  • areashop.limits.survivalshops

Permissions to give to VIP players:

  • areashop.limits.vipdefault
  • areashop.limits.vipcreative
  • areashop.limits.vipsurvivalplots
  • areashop.limits.vipsurvivalshops

Notes:

  • The areashop.limits.default is already given to all players, so there is no need to give that again.
  • It does not matter if the VIP players also have the limit permissions meant for the normal players, if you have 2 limitgroups with the same worlds and groups section it will use the highest numbers (so the VIP limits override).

Prison setup

The setup we want to achieve

There are ranks A to C in a prison, players start with rank A. This setup assumes that these ranks do not inherit permissions of eachother (inherit option of your permissions plugin is set to a default rank for all of them).

  • Rank A can rent 1 cell in hallway A.
  • Rank B can rent 1 cell in hallway B, nothing in A.
  • Rank C can rent 2 cells in hallway C, nothing in A or B.

This means that players can only rent cells in their own hallway, but when they rankup they might temporarily have a cell in the previous one (until it runs out, they should not be able to extend it).

Explanation video made by ArmyStich

The video explains how to implement the prison setup as described in this section.
Tutorial Video

Groups setup

Add all cells from hallway A to the group hallway-a:

  • Make a selection intersecting all shop regions.
  • Use the following command: /as groupadd hallway-a.

Repeat the same thing for cells in hallway B and C, but then with the group names hallway-b and hallway-c.

Setup of limit groups in the config.yml file

limitGroups:
  default:
    total: 2
    rents: 2
    buys: 0
  allow-hall-a:
    total: 1
    rents: 1
    buys: 0
    groups:
    - 'hallway-a'
  block-hall-a:
    total: 0
    rents: 0
    buys: 0
    groups:
    - 'hallway-a'
  allow-hall-b:
    total: 1
    rents: 1
    buys: 0
    groups:
    - 'hallway-b'
  block-hall-b:
    total: 0
    rents: 0
    buys: 0
    groups:
    - 'hallway-b'
  allow-hall-c:
    total: 2
    rents: 2
    buys: 0
    groups:
    - 'hallway-c'
  block-hall-c:
    total: 0
    rents: 0
    buys: 0
    groups:
    - 'hallway-c'

Permissions setup

Use your permissions plugin to give the correct permissions to certain players as listed below.

Permissions to place in your default group (all other groups inherit from this one):

  • areashop.limits.block-hall-a
  • areashop.limits.block-hall-b
  • areashop.limits.block-hall-c

Permissions to give to rank A players:

  • areashop.limits.allow-hall-a

Permissions to give to rank B players:

  • areashop.limits.allow-hall-b

Permissions to give to rank C players:

  • areashop.limits.allow-hall-c

If you do not have a default group then you could also simply paste those permissions inside every rank.

Notes:

  • If you want higher-rank players to still be able to rent cells of lower levels, then you could add the allow permissions of those halls to their permissions also. Or if your higher ranks inherit from the lower ranks then you could use the exact setup as show above (but then the intended setup does not work as described).