-
Notifications
You must be signed in to change notification settings - Fork 1
/
CommandRemoveColor.cs
37 lines (30 loc) · 1.26 KB
/
CommandRemoveColor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Rocket.API;
using Rocket.Unturned.Chat;
using Rocket.Unturned.Player;
using System.Collections.Generic;
using UnityEngine;
namespace ExtraConcentratedJuice.Colorize
{
public class CommandRemoveColor : IRocketCommand
{
public AllowedCaller AllowedCaller => AllowedCaller.Player;
public string Name => "removecolor";
public string Help => "Removes your chat color.";
public string Syntax => "/removecolor";
public List<string> Aliases => new List<string> { "resetcolor" };
public List<string> Permissions => new List<string> { "colorize.remove" };
public void Execute(IRocketPlayer caller, string[] args)
{
UnturnedPlayer uPlayer = (UnturnedPlayer)caller;
if (Colorize.instance.playerColors.TryGetValue(uPlayer.Id, out Color color))
{
Colorize.instance.playerColors.Remove(uPlayer.Id);
UnturnedChat.Say(uPlayer, Colorize.instance.Translations.Instance.Translate("colorize_reset_success"), UnityEngine.Color.green);
}
else
{
UnturnedChat.Say(uPlayer, Colorize.instance.Translations.Instance.Translate("colorize_no_color_set"), UnityEngine.Color.red);
}
}
}
}