Offline Player Permissions

Discussion in 'Plugin Development' started by Deathmarine, May 24, 2012.

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

    Deathmarine

    I'm trying to check if players have a permission offline via:
    //Shortened
    plugin.getServer().getOfflinePlayer(playername).getPlayer().hasPermission("example.perm");

    This will always return false. Any ideas?

    Alright so here is a better example:
    Code:java
    1.  
    2.  
    3. public boolean testPermission(String arg){
    4. Player player = plugin.getServer().getPlayer(arg);
    5. String perm = "example.test";
    6. if(player != null){
    7. if(player.hasPermission(perm)) return true;
    8. return false;
    9. }else{
    10. player = plugin.getServer().getOfflinePlayer(arg).getPlayer();
    11. if(player != null && player.hasPermission(perm)) return true;
    12. return false;
    13. }
    14. }
    15. }
    16.  

    If I'm online then the method returns true, if I quit then its false.
     
  2. Offline

    russjr08

    My guess would be something with Vault? (Sorry, I'm new to all of this.)
     
  3. Offline

    monster860

    Literally, I had the same problem. I still can't figure it out, but I have bits and pieces:
    Code:
    PermissibleBase pb = new PermissibleBase(getServer().getOfflinePlayer(name));
    // WHAT CODE WILL LOAD THE PERMISSIONS??????
    if (!pb.hasPermission("redstonecash.trust")) {
        p.sendMessage("This device was not created by a trusted player.");
        p.sendMessage("Use at your own risk.");
    }
     
  4. You must know that most permissions plugins using superperm register the permissions when they join, and remove the permissions when they leave, so this is technicly not posible to do whitout hooking inside the plugins that give the permissions
     
Thread Status:
Not open for further replies.

Share This Page