Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal class GrantPermission : CovalencePlugin
- {
- private void Init() => AddCovalenceCommand("oxide", "GrantCmd");
- private void GrantCmd(IPlayer player, string command, string[] args) //oxide grant group default economics.balance
- {
- if (player != null && !player.IsAdmin) return;
- if (args?.Length == 4)
- {
- if (args[0] == "grant")
- {
- if (args[1] == "user")
- {
- permission.GrantUserPermission(args[2], args[3], null);
- }
- else if (args[1] == "group")
- {
- permission.GrantGroupPermission(args[2], args[3], null);
- }
- }
- else if (args[0] == "revoke")
- {
- if (args[1] == "user")
- {
- permission.RevokeUserPermission(args[2], args[3]);
- }
- else if (args[1] == "group")
- {
- permission.RevokeGroupPermission(args[2], args[3]);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement