[Tutorial] Understanding PermissionsEX's Weight System

Discussion in 'Systems Administration' started by MrEminent42, May 28, 2015.

  1. I've noticed that a lot of people do not understand PermissionsEX's weight system. So, I'll explain it! I will be using ranks Owner, Admin, A, B, C, D, E, VIP, and VIP+.

    This tutorial will be guided towards Prison Servers, but can be morphed into working with other servers. This tutorial is only for PermissionsEX, and will not be the same with other permissions plugins.


    The basics

    I first want to say, if a player is put in a group, they will have the permissions of that group and all inherited groups no matter what. Even if they are in a different group with a higher rank.

    Think of weights as a rank. What's the highest rank? Well, rank #1 of course, like the CEO of a business. So, what would be the #1 rank on your server, out of ALL the groups? Probably owner. So, we'll set the owner rank as rank #1 (weight: '1'). So, what's the next highest rank on your server? I'll say admin. It's the second highest rank, so we will put it as rank #2 (weight: '2'). Moderator would probably be rank #3, and so on.

    What's next? Well, after the main ones (owner, admin, mod etc.) we have our rankup ranks (A, B, C, D, E), we will call them letter ranks (for the purpose of this tutorial, we will say E is the highest rank on our server). But why isn't it the Donor ranks? Aren't those more important? Think for a second. The main point of a prison server is to get from A to E, and a person can get a donor rank to help boost them along. So, next comes the letter ranks. What is the lowest or beginning letter rank? It isn't E because that's the very last rank. Whats the very first rank, the one you automatically have? Well, usually its A. So, we will set A to be rank #100 (weight: '100'). Remember, the bigger the number, the lower the rank. When a player ranks up, would the next rank be a higher rank or lower rank? I mean, rank B is higher than A on prison servers, isn't it? That means B is a higher rank than A, so we will set rank B to be rank #99 (weight: '99'). Then C is #98, and so on.

    Now for donor ranks. Let's think of them as interns. They do work for you, and they don't have much say in things. So, they are a really low rank. Lets say in the 1000's. The first donor rank, the most basic one (we'll call it VIP) is the lowest of the donor ranks. So, lets say it is rank #1000. The second one is a higher rank than the basic donor rank, but lower than the letter ranks. Therefor, we should set it as rank #999. Then the one above that is rank #998 and so on.

    Using this with a rankup plugin? Scroll down!


    What this actually does

    Here is an explanation of what all this stuff actually does in the plugin.

    Chat:
    When PermissionsEX checks for prefixes and suffixes, it checks the groups with the lowest weights (highest ranks) first. So, if you are in Owner, A, VIP, and VIP+, it would see Owner as the highest rank (if you have your weights right) and check for prefixes and suffixes. If it has either, it will apply them. Say it only has a prefix, it will apply the prefix and go on looking for the suffix. It checks A, because that's the next highest rank. It sees that A does not have a suffix, so it moves on. It sees that the player is in both VIP and VIP+ groups, and knows that VIP+ is a higher rank, and takes the suffix from VIP+.

    Understanding this with Rankup Plugins (And Vault):
    Most rankup plugins use the primary group to see if the player can rankup. In this case, it would be the letter ranks. But, how does PEX tell the rankup plugin that the primary groups are the letter groups? Well, using the weight system, of course! The player can be in multiple groups, and have the letter ranks be the primary group. If you have your weights setup correctly, PermissionsEX will tell vault Vault who will will tell your Rankup plugin that your letter rank is the primary rank.

    UPDATE 6/4/2015: I forgot this part.
    If you are using a rankup plugin, and you want your staff to be able to play, make sure you have your Staff have a lower rank than your letter ranks. For example A could be 100 and Admin could be 200 and VIP could be 1000. This does mean that the Letter ranks will take priority over Staff, which means that the letter rank prefixes will override Staff's prefixes. I recommend you give your staff Suffixes, as well as for Donor ranks.

    Here is an example permissions.yml that you could use with EZRanksLite:
    Code (YAML):
    groups:
      Owner
    :
        permissions
    :
       - some.owner.permission
        options
    :
          weight
    : '200'
          prefix
    : '&f[&6Owner&f] &4'
      Admin
    :
        permissions
    :
       - some.staff.permission
        options
    :
          weight
    : '201'
          prefix
    : '&f[&6Admin&f] &4'
      A
    :
        permissions
    :
       - some.permission
        options
    :
          default
    : true
          weight
    : '100'
          prefix
    : '&f[&aA&f] &7'
      B
    :
        permissions
    :
       - some.permission
        options
    :
          weight
    : '99'
          prefix
    : '&f[&bB&f] &7'
        inheritance
    :
       - A
      C
    :
        permissions
    :
       - some.permission
        options
    :
          weight
    : '98'
          prefix
    : '&f[&cC&f] &7'
        inheritance
    :
       - B
      D
    :
        permissions
    :
       - some.permission
        options
    :
          weight
    : '97'
          prefix
    : '&f[&3D&f] &7'
        inheritance
    :
       - C
      E
    :
        permissions
    :
       - some.permission
        options
    :
          weight
    : '96'
          prefix
    : '&f[&3E&f] &7'
        inheritance
    :
       - D
      VIP
    :
        permissions
    :
       - some.donator.permission
        options
    :
          weight
    : '1000'
          suffix
    : ' &f[&eVIP&f]'
      VIP+
    :
        permissions
    :
       - some.donator.permission
        options
    :
          weight
    : '999'
          suffix
    : ' &f[&eVIP+&f]'
        inheritance
    :
       - VIP

    FAQ

    Q: What is vault? How do I use it?
    A: Vault is an amazing plugin that makes sure that all permissions, economy, and chat plugins work together. You can download vault here, and you can basically drag and drop it into your plugins folder and you're good. Just make sure you have a permissions plugin and an economy plugin!

    Q: Which has a lower weight, letter ranks or donor ranks?
    A: As explained above, the letter ranks have a lower rank. This is because it always needs to be the primary group you are in, so that you are always on track to rankup.

    Q: What if I want my staff to be able to rankup and play too?
    A: Just updated the tutorial, scroll up!

    Q: With this weights setup, do I need to make a rankup for each donor rank?
    A: No. With this setup, the rankup ranks are the main ranks, so rankup plugins will be able to rank players up. If you add players to a donor group, go right ahead. It wont effect the main group at all, because the weights are higher (lower rank) than the rankup ranks. The player will still have the donor permissions.

    Ask more questions, I'll add them here!


    Tips & Tricks

    • Don't use rank: '#' unless you know what you're doing, setting a rank for a group is totally different from setting a weight.
    • Don't go to past 10k in weights, there is no need for it, and it saves some resources :p

    Did I help you in this post? Please leave a Like, Useful, or Informative rating!
     
    #1 MrEminent42, May 28, 2015
    Last edited: Aug 22, 2015
    • Informative Informative x 16
    • Like Like x 13
    • Useful Useful x 10
    • Winner Winner x 5
  2. Is there any way to apply an intern/main rank and rankup rank to a player on their first join?

    My network has 4 main ranks and 4 donor ranks

    Main: Player, Mod, Admin, Owner
    Donor: MVP, VIP, Elite, Ultimate

    On all servers except Prison the standard chat format looks like this:

    PLAYER superzyr > This is a message
    VIP superzyr > This is a message
    MOD superzyr > This is a message

    etc.

    For Prison specifically I would like players to still retain the main/donor rank as well as the rankup rank.

    Eg.

    PLAYER [A] superzyr > This is a message
    VIP [A] superzyr > This is a message
    MOD [A] superzyr > This is a message

    Is this possible to achieve?
     
  3. I'm not sure. I think this would require a chat formatting plugin. The only thing weights do that is related to chat is determine which prefixes and suffixes the player should, not the order of the display name.

    And, just to make sure you understand, the main rank is the one the player is ranking up on. A-Z.

    EDIT: I'm looking into a good plugin to do this, because I'd love to have this too.
     
    #3 MrEminent42, May 28, 2015
    Last edited: Jun 29, 2015
    • Creative Creative x 1
  4. For a Prison server using PEX I have the rankup ranks applied to a rank-ladder

    So my PEX setting would be
    A
    rank: '5000'
    B
    rank: '4900'

    etc.

    Is this necessary? It might be what is conflicting with multiple ranks but it's what I currently have set so that when a player is eligible to rankup the console issues the command /pex promote <player>

    Do other Prison servers just set up EZRanksLite to run the command /pex user <player> group set <rank>?
     
  5. Well most servers just use the weight system. I suppose you can use the rank ladder system to make it easier, to just that 1 promote command instead of two. I haven't looked into rank ladders yet, so I'll get back to you when I have more information.

    And you should not use /pex user <user> group set <group>, use group add and group remove.

    Also, you would still need to set the weights though, I think. I'm not sure.
     
  6. Screw those permission plugins.. XD I just made my own ranks system with MYSQL :pPP
    Anyways great tutorial :D
     
    • Like Like x 1
    • Agree Agree x 1
  7. I'm aware of the difference between set, add/remove.

    I use /pex user <name> group set <group> to simulate the new player environment on myself.

    But once I add (pex user <name> group add group) the Owner rank to myself that's when problems occur.

    When I'm just rank A (without Owner group added)

    EZRanksLite plays fine
    [​IMG]

    Once I add Owner group to myself the rank disappears:
    [​IMG]

    But /pex user <name> shows:
    [​IMG]

    I'm assuming it's because Owner (being the highest weight of 1) is not specified in EZRanksLite's rankup.yml

    I am not sure of a workaround, it's really confusing
     
  8. clip

    Benefactor

    Ezrankslite2 has a permission node feature that allows you to assign permissions to each group so it identifies the rankup group based on what perm you have rather than detecting it based off of your primary group. This should be a better system for servers with multiple groups assigned to players.
     
  9. 2? Is it in development at the moment? Sounds like a great solution for prison servers specifically
     
  10. clip

    Benefactor

    Yeah, I have been working on it here and there for a few weeks. I plan on updating to 2.0 pretty soon.
     
    • Like Like x 2
  11. ily <3
     
    • Like Like x 1
  12. For now, you might want to lower the weight on the Owner rank, and make your prefix Owner permanent '/ped user <user> prefix <prefix>'

    I'm not sure why the owner would want to rankup like that Though...
     
  13. I like to test my servers out as owner and player.

    Owner is within the same level of authority (in terms of weight) as Admin and Mod

    If I am to hire some staff to become MOD on my Prison server I don't want to hinder their ability to not play the game. That's why I'm trying to make staff ranks work as well as donor ranks.
     
  14. True true. I should update the post.

    Then set the weights of Mod and Owner to be a higher rank than donor but lower than Letter ranks.
     
  15. did u find a plugin?
     
  16. No...
     
  17. @extended_clip Any chance I could get you to help me out with my chat formatting for this? When I added the weights, my letter ranks defaulted to essentials formatting. All the rest are using the DeluxeChat formatting like they're supposed to.
     
  18. Remove EssentialsChat?
     
  19. when I disabled the group formats, it went to the default <nickname>
     
  20. Yes... Remove the EssentialsChat jar. It's not needed if you have something like DC.