1. Hey all,

    I'm having trouble accessing the "UserHasPermission" bool with JS within the Oxide library. I'm sure it's something simple but it's flying right over my head.

    I've tried various ways, this is one:
    Code:
    if(this.Permission.UserHasPermission(info.Initiator, "barrelpoints.vip")){
      print("HASPERM: TRUE");
    }else{
      print("HASPERM: FALSE");
    }
    
    If I could figure out how to access the Permission class within the Oxide library, It'd be smooth sailing.

    Thanks in advance <3
     
  2. Probably permission.UserHasPermission instead of this.Permission.UserHasPermission.
    The scripting language plugin class doesn't inherit from one of Oxide's plugin types, so libraries are available directly.
     
  3. Alright so after some more research, I figured out that I can just use permission.UserHasPermission(info.)
    Was literally writing a reply just now saying that I figured it out, thank you anyway :p

    UserHasPermission Problem: sqroot's answer is right

    (For future readers)
    New problem I ran into with RegisterPermission:
    As I was trying to register the permission "barrelpoints.vip", I kept on getting errors from the following:
    Code:
    permission.RegisterPermission("barrelpoints.vip", this);
    Although! I figured out that I was missing ".Plugin":
    Code:
    permission.RegisterPermission("barrelpoints.vip", this.Plugin);