C#:
using System.Collections.Generic;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("BlockStashPlacement", "", "1.0.2", ResourceId = 2060)]
public class BlockStashPlacement : RustPlugin
{
void Loaded(){
lang.RegisterMessages(messages, this);
}
Dictionary<string, string> messages = new Dictionary<string, string>()
{
{"MayNotPlace", "<color=red>[BlockStash]</color> Установлен запрет на размещение тайников."},
};
void OnEntitySpawned(BaseEntity entity, GameObject gameObject)
{
if (entity is StashContainer)
{
var stash = entity.GetComponent<StashContainer>();
var player = BasePlayer.FindByID(stash.OwnerID);
if (player != null)
{
SendReply(player, lang.GetMessage("MayNotPlace", this, player.UserIDString));
player.inventory.GiveItem(ItemManager.CreateByItemID(1051155022));
}
stash.DieInstantly();
}
}
}
}