Иконка ресурса

FREE StackSystem : 1.0.3 1.0.3

Нет прав для скачивания
C#:
using System.Linq;
using System.Collections.Generic;
using Oxide.Core;

namespace Oxide.Plugins 
{ 
    [Info("StackSystem", "https://topplugin.ru / https://discord.com/invite/5DPTsRmd3G", "1.0.3")] 
	class StackSystem : RustPlugin 
	{
        private Dictionary<string, int> Stack = new Dictionary<string, int>();

        void OnServerInitialized()
        {
            if (Interface.Oxide.DataFileSystem.ExistsDatafile("StackSystem/ItemList"))
                Stack = Oxide.Core.Interface.Oxide.DataFileSystem.ReadObject<Dictionary<string, int>>("StackSystem/ItemList");
            DataBaseCreate();
        }

        void DataBaseCreate()
        {
            if (!Interface.Oxide.DataFileSystem.ExistsDatafile("StackSystem/ItemList"))
            {
                foreach (var item in ItemManager.itemList)
                    Stack.Add(item.shortname, item.stackable);
                Puts("Дата стаков успешно создана!");
                Oxide.Core.Interface.Oxide.DataFileSystem.WriteObject("StackSystem/ItemList", Stack);  
            }
            StackLoad();
        }

        void StackLoad() 
		{
            foreach (var check in Stack)
            {
                var item = ItemManager.itemList.FirstOrDefault(z => z.shortname == check.Key);
                item.stackable = check.Value;
            }
		}
    }
}

Автор
15FPS
Скачиваний
0
Просмотры
1
Первый выпуск
Обновление
Оценка
0.00 звёзд 0 оценок
Сверху