Solved Vault - Permissions

Discussion in 'Plugin Development' started by HeadGam3z, Nov 26, 2014.

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

    HeadGam3z

    I want to get a player's group and check if it matches a group name in my config.yml, and if it does, do something. The problem is, when I check if it matches, it says there is no match. The group I am looking for is "Guest" to test if there is a match, and the value of group is "Guest".

    Note: I am in the group "Guest" when I test this, of course.

    My check:
    PHP:
    if (vault().getPrimaryGroup(worldPathofflinePlayer).equalsIgnoreCase(group)) {
    // do stuff
    }
    When I use getPrimaryGroup() does not seem to ever match, and just does my "else" - sends a message yada yada yada... And never says that I am in the group "Guest" even though I am.

    I have tried using playerInGroup(), but if you're using GroupManager and the group inherits "Guest", then it says that they are in the group, when their actual group is something else - like Builder; Builder != Guest.

    Nothing is null, just doesn't seem like I can do this - not sure why... Maybe someone with Vault experience can help me out.

    Any help, questions, or suggestions would be great, thanks!
     
  2. Offline

    mythbusterma

    HeadGam3z

    What is "group" in this context? I've never had an issue with that method not matching.
     
  3. Offline

    HeadGam3z

  4. Offline

    mythbusterma

    HeadGam3z

    Are you certain of that? I would write the literal in the argument just so I'm absolutely sure it's not that. Also, are you sure that you don't have an ancillary groups associated with you? I would recommend checking the config of your permission's plugin to be sure there's no other groups at all associated with you.
     
    HeadGam3z likes this.
  5. Offline

    HeadGam3z

    mythbusterma
    Ah, by reading what you said I figured out my issue. Thanks, lifesaver; have a happy thanksgiving!
     
Thread Status:
Not open for further replies.

Share This Page