C#:
// Все права принадлежат дискорд сообществу https://discord.gg/VgNHPpNrz6
/*
TODO:
- Show blocked message via centered GUI overlay
- Move items back to inventory from Research Table
- Add option to remove all deployed Research Tables
- Add option to remove Research Tables in inventory
- Add option to disable crafting of Research Table
- Add permission support to bypass blocks
- Add new hook for when crafting is first started
*/
using System;
using System.Collections.Generic;
namespace Oxide.Plugins
{
[Info("NoResearch", "Wulf/lukespragg", "0.1.1", ResourceId = 0)]
[Description("Blocks item researching completely")]
class NoResearch : RustPlugin
{
// Do NOT edit this file, instead edit NoResearch.en.json in oxide/lang,
// or create a language file for another language using the 'en' file as a default.#region Localization
void LoadDefaultMessages()
{
lang.RegisterMessages(new Dictionary<string, string>
{
["NoResearching"] = "Researching items is not allowed!",
["NoResearchTables"] = "Crafting research tables is not allowed!"
}, this);
}
void Init() => LoadDefaultMessages();
#endregion
#region Blocking
object OnItemResearch(Item item, BasePlayer player)
{
PrintToChat(player, Lang("NoResearching", player.UserIDString));
return true;
}
#endregion
#region Helpers
T GetConfig<T>(string name, T value) => Config[name] == null ? value : (T)Convert.ChangeType(Config[name], typeof(T));
string Lang(string key, string id = null, params object[] args) => string.Format(lang.GetMessage(key, this, id), args);
#endregion
}
}