-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommandSellAll.cs
64 lines (55 loc) · 1.65 KB
/
CommandSellAll.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using Rocket.API;
using Rocket.Unturned.Chat;
using Rocket.Unturned.Player;
using Rocket.Core.Logging;
using System.Collections.Generic;
using UnityEngine;
namespace NEXIS.SellAll
{
public class CommandSellAll : IRocketCommand
{
public AllowedCaller AllowedCaller
{
get { return AllowedCaller.Player; }
}
public bool AllowFromConsole
{
get { return false; }
}
public string Name
{
get { return "sellall"; }
}
public string Help
{
get { return "Sells all of the items in your inventory for credits."; }
}
public string Syntax
{
get { return "/sellall"; }
}
public List<string> Aliases
{
get { return new List<string>(); }
}
public List<string> Permissions
{
get { return new List<string>() { "nexis.sellall" }; }
}
public void Execute(IRocketPlayer caller, params string[] param)
{
UnturnedPlayer player = (UnturnedPlayer)caller;
if (SellAll.Instance.Configuration.Instance.SellAllEnabled)
{
// sell all player inventory items
SellAll.Instance.SellAllItems(player);
UnturnedChat.Say(player, SellAll.Instance.Translations.Instance.Translate("sellall_done"), Color.green);
}
else
{
// sellall is disabled in config
UnturnedChat.Say(caller, SellAll.Instance.Translations.Instance.Translate("sellall_disabled"), Color.red);
}
}
}
}