Varied Permissions

Discussion in 'Plugin Development' started by 567legodude, Nov 27, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    567legodude

    I want to make it so that you can give a player a permission such as game.multiplier.2
    And using that permission would give them a 2x multiplier. That's the easy part, but what I need to know is how do I make it so they can do multipliers like 3, 4, 5, 15, 30, 100 etc. without having to check for each individual permission?
    Is there a way I can get a list of a player's permissions and see if any of them start with game.multiplier?

    Just some way for me to have game.multiplier.# and not have to add every possible number into the plugin.
     
  2. Offline

    Skionz

    567legodude Iterate through the players permissions then parse the permission and get the end number.
     
  3. Offline

    567legodude

    Where do I get the list of permissions from. Is there a method for players that does that? Otherwise, I don't have a list of permissions. Because that's what I thought about doing but I don't know if there was a way to get all the permissions a player has.
     
  4. Offline

    teej107

  5. Offline

    567legodude

    teej107 That still leaves the problem that there is no method for getting a list of the player's permissions. I didn't just ask without searching first.
     
  6. 567legodude
    Player#getEffectivePermissions().

    indyetoile
    That's not what he asked.

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

    567legodude

    Assist I found that, but that only gets the permissions that are registered with the server. So unless I add every possible number into the plugin, it won't work. I saw somewhere that vault actually adds the permissions into the server when you give them. But I don't want to make vault a dependency.
     
  8. Offline

    Rocoty

    567legodude I don't know if it actually has to be registered, but if you register game.multiplier.* you should be fine.
     
  9. Offline

    567legodude

    I guess I will just make it so that there is another config that holds the player data. And instead of using permissions, the plugin will just store their data in the config, and pull the data from there. It will be easier that way, and I won't have to iterate through a list of permissions. I can just grab their name from the config.

    Rocoty Well, if I give a player a permission that was not registered in a plugin, then it will not show up in the list. I guess I will try game.multiplier.* and see how that goes.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 29, 2016
Thread Status:
Not open for further replies.

Share This Page