Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Oxide.Plugins;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Oxide.Core.Libraries.Covalence;
- namespace Oxide.Plugins
- {
- [Info("HelpCommand", "avi", "1.0.1")]
- [Description("Help command")]
- public class HelpCommand : RustPlugin
- {
- private PluginConfig config;
- private void Init()
- {
- cmd.AddChatCommand("help", this, "CommandHelp");
- config = Config.ReadObject<PluginConfig>();
- }
- private void CommandHelp(BasePlayer player, string help, string[] args)
- {
- PrintWarning("Start");
- string message = lang.GetMessage("HelpFormat", this, player.UserIDString) + "\n";
- foreach (KeyValuePair<string, string> commandsDictionary in config.MessageList)
- {
- string format = lang.GetMessage("CommandFormat", this, player.UserIDString);
- message += String.Format(format, commandsDictionary.Key, commandsDictionary.Value);
- }
- player.ChatMessage(message);
- }
- protected override void LoadDefaultConfig()
- {
- Config.WriteObject(GetDefaultConfig(), true);
- }
- protected override void LoadDefaultMessages()
- {
- lang.RegisterMessages(new Dictionary<string, string>
- {
- ["HelpFormat"] = "<color=#ffa500>Here is a list of commands for our server:\n",
- ["CommandFormat"] = "<color=#ffff>/</color><color=#ffa500>{0}<color=#ffff00>:</color> <color=#ffff00>{1}</color>\n"
- }, this);
- }
- private void SaveConfig()
- {
- Config.WriteObject(config, true);
- }
- private PluginConfig GetDefaultConfig()
- {
- return new PluginConfig
- {
- MessageList = new Dictionary<string, string>()
- {
- ["mymini"] = "Spawn a minicopter.",
- ["turret"] = "Turn on any turret you're looking at. Requires ammo and a gun.",
- ["turret.tc"] = "Turn all turrets connected to your Tool Cupboard on at once. [VIP]",
- ["skinbox"] = "Skin your items ['Dedicated' rank or VIP.",
- ["playtime (optional:top)"] = "Check your playtime or the top playtime in the server.",
- ["bgrade"] = "BGrade lets you automatically upgrade your base to the selected tier when you build. (1 = wood, 2 = stone, etc)",
- ["up"] = "Upgrade your entire base by 1 tier, or specify the tier with /up (tier) to upgrade everything to that tier directly.",
- ["down"] = "Downgrade your entire base by 1 tier, or specify the tier with /down (tier) to downgrade everything to that tier directly.",
- ["limit"] = "Check current entity limit."
- }
- };
- }
- private class PluginConfig
- {
- public Dictionary<string, string> MessageList;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement