Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
780
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. There is a very good wrapper called Pustalorc.ImperialPlugins.Permissions.API.Statics.Utilities that includes most of the ways to interact with the plugin and the provider, however for manual interaction, all you will have to do is cast Rocket.Core.R.Permissions to the type IPermissionsProvider, which includes all the extras on interacting with the permissions provider.
  2.  
  3. For example, to get all groups:
  4. allGroups = ((IPermissionsProvider) R.Permissions).GetGroups().ToList();
  5.  
  6. Make sure to check the Interface to see all the possible interactions.
  7. If you want to interact with a temporary membership whilst the player is online, the best practice, is to use the membership component located in Pustalorc.ImperialPlugins.Permissions.TemporaryMemberships.TemporaryMembershipComponent
  8.  
  9. Example usage:
  10. var timeSinceJoin = DateTime.Now.Subtract(UnturnedPlayer.GetComponent<TemporaryMembershipComponent>().Join);
  11.  
  12. That will then allow you to update the database with new time, or display to the user in a UI how much time they have left.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement