Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.69 KB | None | 0 0
  1. using System;
  2. using UnityEngine;
  3. using Rocket.API;
  4. using Rocket.Unturned.Player;
  5. using Rocket.Unturned;
  6. using Rocket.Unturned.Commands;
  7. using Rocket.Unturned.Chat;
  8. using System.Collections.Generic;
  9. using Rocket.API.Extensions;
  10. using Rocket.API.Serialisation;
  11. using Rocket.Core.Permissions;
  12.  
  13. namespace ColorChange
  14. {
  15.     public class EasyColorChange : IRocketCommand
  16.     {
  17.         IRocketPermissionsProvider permProvider;
  18.         public AllowedCaller AllowedCaller
  19.         {
  20.             get { return AllowedCaller.Both; }
  21.         }
  22.  
  23.         public string Name
  24.         {
  25.             get { return "changecolor"; }
  26.         }
  27.  
  28.         public string Help
  29.         {
  30.             get { return "Change a group's color"; }
  31.         }
  32.  
  33.         public string Syntax
  34.         {
  35.             get { return "<group> <color>"; }
  36.         }
  37.  
  38.         public List<string> Aliases
  39.         {
  40.             get { return new List<string>(){"cc", "changec", "ccolor"}; }
  41.         }
  42.  
  43.         public void Execute(IRocketPlayer caller, string[] command)
  44.         {
  45.             string groupName = command.GetStringParameter(0);
  46.             RocketPermissionsGroup permG = new RocketPermissionsGroup();
  47.             RocketPermissions rPerms = new RocketPermissions();
  48.             string hexColor = command.GetStringParameter(1);
  49.             permProvider.GetGroup(groupName);
  50.             permG.Id = Convert.ToString(permProvider);
  51.             permG.Color = hexColor;
  52.            
  53.         }
  54.  
  55.         public List<string> Permissions
  56.         {
  57.             get
  58.            {
  59.                return new List<string>
  60.               {
  61.                   "milk.changecolor"
  62.               };
  63.            }
  64.         }
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement