Plugin Permissions not working as they should? :(

Discussion in 'Plugin Development' started by Adamki11s, Apr 25, 2011.

Thread Status:
Not open for further replies.
  1. The permissions check is located in the boolean onCommand statement.

    public boolean onCommand(CommandSender sender, Command cmd, String label,
    String[] args) {
    if (!Permissions.has((Player)sender , "confess.*")) {
    sender.sendMessage(ChatColor.RED + "[CONFESS] You are not allowed access to this command.");
    return false;
    } else {
    //My Plugin Code;
    }

    As you can see I have to cast the 'sender' to type player and for some reason this isn't working.
    Is there any other way that I can convert the 'sender' to player type to see if it works?

    Thanks

    Sorted, thanks for the help...

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

Share This Page