Advertisement
Guest User

Untitled

a guest
Aug 31st, 2019
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. internal class GrantPermission : CovalencePlugin
  2. {
  3. private void Init() => AddCovalenceCommand("oxide", "GrantCmd");
  4. private void GrantCmd(IPlayer player, string command, string[] args) //oxide grant group default economics.balance
  5. {
  6. if (player != null && !player.IsAdmin) return;
  7. if (args?.Length == 4)
  8. {
  9. if (args[0] == "grant")
  10. {
  11. if (args[1] == "user")
  12. {
  13. permission.GrantUserPermission(args[2], args[3], null);
  14. }
  15. else if (args[1] == "group")
  16. {
  17. permission.GrantGroupPermission(args[2], args[3], null);
  18. }
  19. }
  20. else if (args[0] == "revoke")
  21. {
  22. if (args[1] == "user")
  23. {
  24. permission.RevokeUserPermission(args[2], args[3]);
  25. }
  26. else if (args[1] == "group")
  27. {
  28. permission.RevokeGroupPermission(args[2], args[3]);
  29. }
  30. }
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement