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

FREE MBPrivileges : 1.0.0 1.0.0

Нет прав для скачивания
C#:
using Oxide.Core.Plugins;
using Oxide.Game.Rust.Cui;
using System.Collections.Generic;
using UnityEngine;
using System.Collections;
using Oxide.Core;
using System.Linq;
using Newtonsoft.Json;
namespace Oxide.Plugins {
    [Info("MBPrivileges", "Barry_Allenn", "1.0.0")]
    [Description("MBPrivileges")]
    public class MBPrivileges : RustPlugin {
        [PluginReference]
        private Plugin ImageLibrary, MBMainMenu, MBCoins;
        private ImageUI imageUI = new ImageUI();
        private ConfigData configData;
#region Config
        private class ConfigData {
            [JsonProperty("Привілеї")]
            public List<PrivilegeEntry> Privileges = new();
            // 🔥 добавлено
        }
        public class PrivilegeEntry {
            public string GroupName;
            public string DurationText;
            // Срок (например "7д")
            public int Price;
            // Цена
            public string ImageName;
            // 🔥 Название картинки (например: "Priv_PRO")
            public string LangKey;
            // 🆕 Вместо текста — ключ перевода
        }
        protected override void LoadConfig() {
            base.LoadConfig();
            configData = Config.ReadObject<ConfigData>();
            SaveConfig();
        }
        protected override void SaveConfig() {
            Config.WriteObject(configData, true);
        }
        protected override void LoadDefaultConfig() {
            configData = new ConfigData {
                Privileges = new List<PrivilegeEntry> {
                    new PrivilegeEntry {
                        DurationText = "14d", Price = 10, ImageName = "vip_basic", GroupName = "vip", LangKey = "VIP_Description"
                    }
                    , new PrivilegeEntry {
                        DurationText = "14d", Price = 15, ImageName = "premium_basic", GroupName = "premium", LangKey = "PREMIUM_Description"
                    }
                    , new PrivilegeEntry {
                        DurationText = "14d", Price = 20, ImageName = "deluxe_basic", GroupName = "deluxe", LangKey = "DELUXE_Description"
                    }
                }
            }
            ;
            SaveConfig();
        }
#endregion
        void Init() {
            LoadConfig();
            // imageUI = new ImageUI();
            // imageUI.DownloadImages();
        }
        private void OnServerInitialized() {
            imageUI = new ImageUI();
            imageUI.DownloadImages();
        }
        void Unload() {
            foreach (var player in BasePlayer.activePlayerList) {
                CuiHelper.DestroyUi(player, "MBPrivileges_UI");
                CuiHelper.DestroyUi(player, "MBPrivileges_inv_UI");
            }
            imageUI?.UnloadImages();
        }
        private void OnPlayerConnected(BasePlayer player) {
            ShowIntroImage(player);
            // ← Добавлено
        }
        private void ShowIntroImage(BasePlayer player) {
            CuiHelper.DestroyUi(player, "MBPrivileges_IntroUI");
            var container = new CuiElementContainer();
            string imageId = imageUI?.GetImage("MBWelcome_Four_Os");
            if (string.IsNullOrEmpty(imageId)) {
                PrintWarning("[MBPrivileges] Intro image not loaded");
                return;
            }
            container.Add(new CuiElement {
                Name = "MBPrivileges_IntroUI", Parent = "Overlay", Components = {
                    new CuiRawImageComponent {
                        Png = imageId, Color = "1 1 1 0",  // полная непрозрачность картинки
                        Sprite = "assets/content/textures/generic/fulltransparent.tga"
                    }
                    , new CuiRectTransformComponent {
                        AnchorMin = "0 0", AnchorMax = "1 0.5"
                    }
                }
            }
            );
            CuiHelper.AddUi(player, container);
            timer.Once(0.5f, () => {
                CuiHelper.DestroyUi(player, "MBPrivileges_IntroUI");
            }
            );
        }
#region PrivilegesUI
        [HookMethod("OpenPrivilegesForPlayer")]
        private void ShowPrivilegesUI(BasePlayer player) {
            CuiHelper.DestroyUi(player, "MBPrivileges_UI");
            var container = new CuiElementContainer();
            string root = container.Add(new CuiPanel {
                Image = {
                    Color = "0 0 0 0"
                }
                , RectTransform = {
                    AnchorMin = "0 0", AnchorMax = "1 1"
                }
                , CursorEnabled = true
            }
            , "Overlay", "MBPrivileges_UI");
            string backgroundPanel = container.Add(new CuiPanel {
                Image = {
                    Color = "0 0 0 0.7", Material = "assets/content/ui/uibackgroundblur.mat"
                }
                , RectTransform = {
                    AnchorMin = "0 0", AnchorMax = "1 1"
                }
                , CursorEnabled = true
            }
            , root);
            string imageId = imageUI?.GetImage("MBWelcome_Four_Os");
            if (!string.IsNullOrEmpty(imageId)) {
                container.Add(new CuiElement {
                    Name = CuiHelper.GetGuid(), Parent = root, Components = {
                        new CuiRawImageComponent {
                            Png = imageId
                        }
                        , new CuiRectTransformComponent {
                            AnchorMin = "0.5 0.5", AnchorMax = "0.5 0.5", OffsetMin = "-558 -314", OffsetMax = "558 315"
                        }
                    }
                }
                );
            }
            // Добавляем кнопку закрытия UI
            container.Add(new CuiButton {
                Button = {
                    Color = "0 0 0 0", Close = "MBPrivileges_UI"
                }
                , RectTransform = {
                    AnchorMin = "0 0", AnchorMax = "1 1"
                }
                , Text = {
                    Text = "", FontSize = 0
                }
            }
            , root);
            string centerPanel = container.Add(new CuiPanel {
                Image = {
                    Color = "0.1 0.1 0.1 0"
                }
                , RectTransform = {
                    AnchorMin = "0.5 0.5", AnchorMax = "0.5 0.5", OffsetMin = "-438 -265",  // ширина 800, высота 600
                    OffsetMax = "440 265"
                }
                , CursorEnabled = true
            }
            , root);
            container.Add(new CuiLabel {
                RectTransform = {
                    AnchorMin = "0.341 0.86", AnchorMax = "0.75 0.955"
                }
                , Text = {
                    Text = Msg("MB_Privileges_Player", player.userID.ToString()), Color = "1 1 1 0.9", Align = TextAnchor.MiddleLeft, FontSize = 30
                }
            }
            , centerPanel);
            container.Add(new CuiLabel {
                RectTransform = {
                    AnchorMin = "0.341 0.8", AnchorMax = "0.8 0.868"
                }
                , Text = {
                    Text = Msg("MB_Privileges_Player_2", player.userID.ToString()), Color = "1 1 1 0.9", Align = TextAnchor.MiddleLeft, FontSize = 21, Font = "permanentmarker.ttf"
                }
            }
            , centerPanel);
            container.Add(new CuiLabel {
                Text = {
                    Text = Msg("MB_Close_Privileges", player.userID.ToString()), FontSize = 13, Color = "1 1 1 0.4", Align = TextAnchor.MiddleCenter
                }
                , RectTransform = {
                    AnchorMin = "0.2 -0.06", AnchorMax = "0.8 -0.02"
                }
            }
            , centerPanel);
            container.Add(new CuiButton {
                Button = {
                    Command = "mbprivilege.back",  // кастомная команда
                    Color = "0.2 0.5 0.8 0"
                }
                , RectTransform = {
                    AnchorMin = "0.865 0.04", AnchorMax = "0.947 0.12"
                }
                , Text = {
                    Text = Msg("MB_Back", player.UserIDString), FontSize = 15, Align = TextAnchor.MiddleCenter, Color = "1 1 1 1"
                }
            }
            , centerPanel);
            // Прокрутка
            float blockHeight = 242f;
            float blockMargin = 8f;
            float verticalShift = 3f;
            int total = configData.Privileges.Count;
            int rowCount = Mathf.CeilToInt(total / 3f);
            float totalHeight = rowCount * (blockHeight + blockMargin);
            float minVisibleHeight = 300f;
            float scrollContentHeight = Mathf.Max(totalHeight, minVisibleHeight);
            container.Add(new CuiElement {
                Name = "MBMenuScrollablePrivileges", Parent = centerPanel, Components = {
                    new CuiScrollViewComponent {
                        Vertical = true, Horizontal = false, Inertia = true, Elasticity = 0.2f, DecelerationRate = 0.2f, ScrollSensitivity = 30f, ContentTransform = new CuiRectTransform {
                            AnchorMin = "0 1", AnchorMax = "1 1", OffsetMin = $"0 -{scrollContentHeight}", OffsetMax = "0 0"
                        }
                        , VerticalScrollbar = new CuiScrollbar {
                            Size = 4f, AutoHide = false, HandleColor = "0.3 0.6 0.9 0.7", TrackColor = "0.1 0.1 0.1 0.6"
                        }
                    }
                    , new CuiRectTransformComponent {
                        AnchorMin = "0.34 0.285", AnchorMax = "0.96 0.75"
                    }
                    , new CuiNeedsCursorComponent()
                }
            }
            );
            container.Add(new CuiPanel {
                Image = {
                    Color = "0 0 0 0"
                }
                , RectTransform = {
                    AnchorMin = "0 1", AnchorMax = "1 1", OffsetMin = $"0 -{scrollContentHeight}", OffsetMax = "0 0"
                }
            }
            , "MBMenuScrollablePrivileges", "MBMenuPrivilegeContent");
            // Привілеї
            for (int i = 0; i < total; i++) {
                int row = i / 3;
                int col = i % 3;
                float topOffset = -(row * (blockHeight + blockMargin)) - verticalShift;
                float bottomOffset = topOffset - blockHeight;
                float left = col switch {
                    0 => 0f, 1 => 0.333f, 2 => 0.666f, _ => 0f
                }
                ;
                float right = col == 2 ? left + 0.31f : left + 0.32f;
                var entry = configData.Privileges[i];
                string bgImg = imageUI.GetImage("PrivilegeBG_Default");
                string containerName = $"PrivilegeContainer_{i}";
                // Контейнер для кожного блоку
                container.Add(new CuiPanel {
                    Image = {
                        Color = "0 0 0 0"
                    }
                    , RectTransform = {
                        AnchorMin = $"{left} 1", AnchorMax = $"{right} 1", OffsetMin = $"0 {bottomOffset}", OffsetMax = $"0 {topOffset}"
                    }
                }
                , "MBMenuPrivilegeContent", containerName);
                // Фон
                if (!string.IsNullOrEmpty(bgImg)) {
                    container.Add(new CuiElement {
                        Name = $"PrivilegeBG_{i}", Parent = containerName, Components = {
                            new CuiRawImageComponent {
                                Png = bgImg, Sprite = "assets/content/textures/generic/fulltransparent.tga"
                            }
                            , new CuiRectTransformComponent {
                                AnchorMin = "0 0", AnchorMax = "1 1"
                            }
                        }
                    }
                    );
                }
                string iconImg = imageUI.GetImage(entry.ImageName);
                // 🔥 Уникальное имя картинки из конфига
                if (!string.IsNullOrEmpty(iconImg)) {
                    container.Add(new CuiElement {
                        Name = $"PrivilegeIcon_{i}", Parent = containerName, Components = {
                            new CuiRawImageComponent {
                                Png = iconImg, Sprite = "assets/content/textures/generic/fulltransparent.tga"
                            }
                            , new CuiRectTransformComponent {
                                AnchorMin = "0.05 0.22",  // Позиция (настраивайте как хотите)
                                AnchorMax = "0.95 0.85"
                            }
                        }
                    }
                    );
                }
                // Тривалість
                container.Add(new CuiLabel {
                    Text = {
                        Text = entry.DurationText, FontSize = 12, Align = TextAnchor.MiddleCenter, Color = "1 1 0 0.9"
                    }
                    , RectTransform = {
                        AnchorMin = "0.055 0.872", AnchorMax = "0.222 0.961"
                    }
                }
                , containerName);
                // Ціна
                container.Add(new CuiLabel {
                    Text = {
                        Text = $"{entry.Price}", FontSize = 14, Align = TextAnchor.MiddleLeft, Color = "1 1 1 0.9"
                    }
                    , RectTransform = {
                        AnchorMin = "0.475 0.06", AnchorMax = "0.79 0.16"
                    }
                }
                , containerName);
                //         // Панель-фон
                // container.Add(new CuiPanel
                // {
                //     Image = { Color = "0.67 0.87 0.80 0.2" }, // Темно-сірий прозорий фон
                //     RectTransform = { AnchorMin = "0.055 0.872", AnchorMax = "0.222 0.961" }
                // }, containerName);
                container.Add(new CuiButton {
                    Button = {
                        Color = "0 0 0 0", Command = $"mbwelcome.showprivilege_inv {i}"
                    }
                    , RectTransform = {
                        AnchorMin = "0 0", AnchorMax = "1 1"
                    }
                    , Text = {
                        Text = "", FontSize = 0
                    }
                }
                , containerName);
            }
            CuiHelper.AddUi(player, container);
        }
#endregion
#region PrivilegesinvUI
        private void ShowPrivilegesinvUI(BasePlayer player, PrivilegeEntry entry, int index) {
            CuiHelper.DestroyUi(player, "MBPrivileges_UI");
            CuiHelper.DestroyUi(player, "MBPrivileges_inv_UI");
            var container = new CuiElementContainer();
            string root = container.Add(new CuiPanel {
                Image = {
                    Color = "0 0 0 0"
                }
                , RectTransform = {
                    AnchorMin = "0 0", AnchorMax = "1 1"
                }
                , CursorEnabled = true
            }
            , "Overlay", "MBPrivileges_inv_UI");
            string backgroundPanel = container.Add(new CuiPanel {
                Image = {
                    Color = "0 0 0 0.7", Material = "assets/content/ui/uibackgroundblur.mat"
                }
                , RectTransform = {
                    AnchorMin = "0 0", AnchorMax = "1 1"
                }
                , CursorEnabled = true
            }
            , root);
            string imageId = imageUI?.GetImage("MBWelcome_Four_Inv");
            if (!string.IsNullOrEmpty(imageId)) {
                container.Add(new CuiElement {
                    Name = CuiHelper.GetGuid(), Parent = root, Components = {
                        new CuiRawImageComponent {
                            Png = imageId
                        }
                        , new CuiRectTransformComponent {
                            AnchorMin = "0.5 0.5", AnchorMax = "0.5 0.5", OffsetMin = "-558 -314", OffsetMax = "558 315"
                        }
                    }
                }
                );
            }
            // Добавляем кнопку закрытия UI
            container.Add(new CuiButton {
                Button = {
                    Color = "0 0 0 0", Close = "MBPrivileges_inv_UI"
                }
                , RectTransform = {
                    AnchorMin = "0 0", AnchorMax = "1 1"
                }
                , Text = {
                    Text = "", FontSize = 0
                }
            }
            , root);
            string centerPanel = container.Add(new CuiPanel {
                Image = {
                    Color = "0.1 0.1 0.1 0"
                }
                , RectTransform = {
                    AnchorMin = "0.5 0.5", AnchorMax = "0.5 0.5", OffsetMin = "-438 -265",  // ширина 800, высота 600
                    OffsetMax = "440 265"
                }
                , CursorEnabled = true
            }
            , root);
            container.Add(new CuiLabel {
                Text = {
                    Text = Msg("MB_Close_Privileges", player.userID.ToString()), FontSize = 13, Color = "1 1 1 0.4", Align = TextAnchor.MiddleCenter
                }
                , RectTransform = {
                    AnchorMin = "0.2 -0.06", AnchorMax = "0.8 -0.02"
                }
            }
            , centerPanel);
            container.Add(new CuiButton {
                Button = {
                    Command = "mbprivileges_inv.back",  // кастомная команда
                    Color = "0.2 0.5 0.8 0"
                }
                , RectTransform = {
                    AnchorMin = "0.865 0.04", AnchorMax = "0.947 0.12"
                }
                , Text = {
                    Text = Msg("MB_Back", player.UserIDString), FontSize = 15, Align = TextAnchor.MiddleCenter, Color = "1 1 1 1"
                }
            }
            , centerPanel);
            //     // Панель-фон
            // container.Add(new CuiPanel
            //     {
            //         Image = { Color = "0 0 0 0.9" }, // Темно-сірий прозорий фон
            //         RectTransform = { AnchorMin = "0.751 0.16", AnchorMax = "0.807 0.221" }
            //     }, root);
            //            // Панель-фон
            // container.Add(new CuiPanel
            //     {
            //         Image = { Color = "1 1 1 0.4" }, // Темно-сірий прозорий фон
            //         RectTransform = { AnchorMin = "0.865 0.04", AnchorMax = "0.947 0.12" }
            //     }, centerPanel);
            // Название группы (или просто "VIP")
            container.Add(new CuiLabel {
                Text = {
                    Text = entry.GroupName.ToUpper(), FontSize = 30, Align = TextAnchor.MiddleCenter, Color = "1 1 1 0.9"
                }
                , RectTransform = {
                    AnchorMin = "0.4 0.8", AnchorMax = "0.6 0.85"
                }
            }
            , centerPanel);
            // Картинка привилегии
            string iconImg = imageUI?.GetImage(entry.ImageName);
            if (!string.IsNullOrEmpty(iconImg)) {
                container.Add(new CuiElement {
                    Name = "MBPrivImage", Parent = centerPanel, Components = {
                        new CuiRawImageComponent {
                            Png = iconImg
                        }
                        , new CuiRectTransformComponent {
                            AnchorMin = "0.754 0.571", AnchorMax = "0.95 0.89"
                        }
                    }
                }
                );
            }
            // Описание
            container.Add(new CuiLabel {
                Text = {
                    Text = Msg(entry.LangKey, player.UserIDString), FontSize = 10, Align = TextAnchor.UpperLeft, Color = "1 1 1 0.8", Font = "robotocondensed-regular.ttf"
                }
                , RectTransform = {
                    AnchorMin = "0.34 0.492", AnchorMax = "0.733 0.895"
                }
            }
            , centerPanel);
            // Длительность
            container.Add(new CuiLabel {
                Text = {
                    Text = $"⏳ {entry.DurationText}", FontSize = 14, Align = TextAnchor.MiddleCenter, Color = "1 1 0 0.9"
                }
                , RectTransform = {
                    AnchorMin = "0.76 0.85", AnchorMax = "0.796 0.881"
                }
            }
            , centerPanel);
            // Цена
            container.Add(new CuiLabel {
                Text = {
                    Text = $"{entry.Price}", FontSize = 18, Align = TextAnchor.MiddleLeft, Color = "1 1 1 0.8"
                }
                , RectTransform = {
                    AnchorMin = "0.849 0.49", AnchorMax = "0.946 0.55"
                }
            }
            , centerPanel);
            // Кнопка "Купити"
            container.Add(new CuiButton {
                Button = {
                    Color = "0.2 0.6 0.2 0.0", Command = $"mbprivileges.buy {index}"
                }
                , RectTransform = {
                    AnchorMin = "0.851 0.176", AnchorMax = "0.948 0.235"
                }
                , Text = {
                    Text = Msg("MB_Buy", player.UserIDString), FontSize = 16, Align = TextAnchor.MiddleCenter, Color = "1 1 1 1"
                }
            }
            , centerPanel);
            CuiHelper.AddUi(player, container);
        }
#endregion
#region Command
        [ChatCommand("vip")]
        private void CmdPrivileges(BasePlayer player, string command, string[] args) {
            ShowPrivilegesUI(player);
        }
        [ConsoleCommand("mbwelcome.showprivilege_inv")]
        private void CmdShowPrivilegeInv(ConsoleSystem.Arg arg) {
            var player = arg.Player();
            if (player == null || arg.Args == null || arg.Args.Length == 0) return;
            if (int.TryParse(arg.Args[0], out int index)) {
                if (index >= 0 && index < configData.Privileges.Count) {
                    var entry = configData.Privileges[index];
                    ShowPrivilegesinvUI(player, entry, index);
                }
            }
        }
        [ConsoleCommand("mbprivilege.back")]
        private void CmdBack(ConsoleSystem.Arg arg) {
            var player = arg.Connection?.player as BasePlayer;
            if (player == null) return;
            CuiHelper.DestroyUi(player, "MBPrivileges_UI");
            MBMainMenu?.Call("ShowMainMenu", player);
        }
        [ConsoleCommand("mbprivileges_inv.back")]
        private void CmdBackinv(ConsoleSystem.Arg arg) {
            var player = arg.Connection?.player as BasePlayer;
            if (player == null) return;
            CuiHelper.DestroyUi(player, "MBPrivileges_inv_UI");
            ShowPrivilegesUI(player);
        }
        [ConsoleCommand("mbprivileges.buy")]
        private void CmdBuyPrivilege(ConsoleSystem.Arg arg) {
            var player = arg?.Player();
            if (player == null || arg.Args == null || arg.Args.Length == 0) return;
            if (!int.TryParse(arg.Args[0], out int index)) return;
            if (index < 0 || index >= configData.Privileges.Count) return;
            var entry = configData.Privileges[index];
            float price = entry.Price;
            ulong userId = player.userID;
            float currentBalance = (float)(MBCoins?.Call("API_GET_BALANCE", userId) ?? 0f);
            if (currentBalance < price) {
                player.ChatMessage($"Недостатньо MBCoins.Потрібно {price}, у вас {currentBalance}.");
                return;
            }
            MBCoins?.Call("API_PUT_BALANCE_MINUS", userId, price);
            player.ChatMessage($"Ви купили привілей: {entry.GroupName} за {price} MBCoins!");
            Server.Command($"addgroup {player.UserIDString} {entry.GroupName} {entry.DurationText}");
            CuiHelper.DestroyUi(player, "MBPrivileges_inv_UI");
            ShowPrivilegesUI(player);
        }
#endregion
#region ImageUI
        private class ImageUI {
            private const string PathFolder = "MBSystem/MBPrivileges/Images/";
            private readonly Dictionary<string, ImageData> _images = new() {
                {
                    "MBWelcome_Four_Os", new ImageData()
                }
                , {
                    "PrivilegeBG_Default", new ImageData()
                }
                , {
                    "MBWelcome_Four_Inv", new ImageData()
                }
                , {
                    "archon_basic", new ImageData()
                }
                , {
                    "vip_basic", new ImageData()
                }
                , {
                    "premium_basic", new ImageData()
                }
                , {
                    "deluxe_basic", new ImageData()
                }
                , {
                    "elita_basic", new ImageData()
                }
                ,
            }
            ;
            private enum ImageStatus {
                NotLoaded, Loaded, Failed
            }
            private class ImageData {
                public ImageStatus Status = ImageStatus.NotLoaded;
                public string Id {
                    get;
                    set;
                }
            }
            public string GetImage(string name) {
                if (_images.TryGetValue(name, out var image) && image.Status == ImageStatus.Loaded) return image.Id;
                return null;
            }
            public void DownloadImages() {
                string fullPath = Interface.Oxide.DataDirectory + System.IO.Path.DirectorySeparatorChar + PathFolder;
                if (!System.IO.Directory.Exists(fullPath)) {
                    System.IO.Directory.CreateDirectory(fullPath);
                    Interface.Oxide.LogInfo($"[MBPrivileges] Создана папка: {fullPath}");
                }
                var nextImage = _images.FirstOrDefault(img => img.Value.Status == ImageStatus.NotLoaded);
                if (!string.IsNullOrEmpty(nextImage.Key)) ServerMgr.Instance.StartCoroutine(LoadImage(nextImage));
                else Interface.Oxide.LogInfo("[MBPrivileges] Все изображения загружены!");
            }
            private IEnumerator LoadImage(KeyValuePair<string, ImageData> image) {
                string filePath = "file://" + Interface.Oxide.DataDirectory + System.IO.Path.DirectorySeparatorChar + PathFolder + image.Key + ".png";
                using (var www = UnityEngine.Networking.UnityWebRequestTexture.GetTexture(filePath)) {
                    yield return www.SendWebRequest();
                    if (www.result != UnityEngine.Networking.UnityWebRequest.Result.Success) {
                        image.Value.Status = ImageStatus.Failed;
                        Interface.Oxide.LogWarning($"[MBPrivileges] Ошибка загрузки {image.Key}");
                    }
                    else {
                        Texture2D texture = UnityEngine.Networking.DownloadHandlerTexture.GetContent(www);
                        image.Value.Id = FileStorage.server.Store(texture.EncodeToPNG(), FileStorage.Type.png, CommunityEntity.ServerInstance.net.ID).ToString();
                        image.Value.Status = ImageStatus.Loaded;
                        UnityEngine.Object.DestroyImmediate(texture);
                    }
                    DownloadImages();
                    // Попытка загрузить следующую
                }
            }
            public void UnloadImages() {
                foreach (var img in _images) {
                    if (img.Value.Status == ImageStatus.Loaded && img.Value.Id != null) FileStorage.server.Remove(uint.Parse(img.Value.Id), FileStorage.Type.png, CommunityEntity.ServerInstance.net.ID);
                }
                _images.Clear();
            }
        }
#endregion
#region Lang
        protected override void LoadDefaultMessages() {
            lang.RegisterMessages(new Dictionary<string, string> {
                ["MB_Close_Privileges"]
                = "Click on an empty space to close the menu", ["MB_Privileges_Player"] = "PRIVILEGES", ["MB_Privileges_Player_2"] = "<color=#FFD700>Being the best</color> is easy with VIP!", ["MB_Back"] = "Back", ["MB_Buy"] = "Buy", ["VIP_Description"] = "Prefix <color=#EFBF00>[VIP]</color> on our server.\n\n              <color=#0057B7>Take pride in supporting</color> <color=#FFD700>the Ukrainian community!</color>\n\nResource gathering rate <color=#ff4500>x1.3</color>\nComponent gathering rate <color=#ff4500>x1.3</color>\nQuarry gathering rate <color=#ff4500>x1.3</color>\n\nWorkbench works throughout the entire house\nMetabolism.Always wake up well-fed.\nUnbreakable tools.No need to craft dozens of pickaxes and axes anymore - one is enough.(Unbreakable doesn't work in others' builds)\nUnbreakable armor and weapons.\nUnbreakable access cards.You no longer need to stockpile them - just one is enough.\nInfinite diving tank.", ["PREMIUM_Description"] = "Prefix <color=#410cf0>[PREMIUM]</color> on our server.\n\n              <color=#0057B7>Take pride in supporting</color> <color=#FFD700>the Ukrainian community!</color>\n\nResource gathering rate <color=#ff4500>x1.5</color>\nComponent gathering rate <color=#ff4500>x1.5</color>\nQuarry gathering rate <color=#ff4500>x1.5</color>\n\nWorkbench works throughout the entire house\nMetabolism.Always wake up well-fed.\nUnbreakable tools.No need to craft dozens of pickaxes and axes anymore - one is enough.(Unbreakable doesn't work in others' builds)\nUnbreakable armor and weapons.\nUnbreakable access cards.You no longer need to stockpile them - just one is enough.\nInfinite diving tank.", ["DELUXE_Description"] = "Prefix <color=#00ccff>[DELUXE]</color> on our server.\n\n              <color=#0057B7>Take pride in supporting</color> <color=#FFD700>the Ukrainian community!</color>\n\nResource gathering rate <color=#ff4500>x2.1</color>\nComponent gathering rate <color=#ff4500>x2.1</color>\nQuarry gathering rate <color=#ff4500>x2.1</color>\n\nWorkbench works throughout the entire house\nMetabolism.Always wake up well-fed.\nUnbreakable tools.No need to craft dozens of pickaxes and axes anymore - one is enough.(Unbreakable doesn't work in others' builds)\nUnbreakable armor and weapons.\nUnbreakable access cards.You no longer need to stockpile them - just one is enough.\nInfinite diving tank.", ["ELITA_Description"] = "Prefix <color=#9d00ff>[ELITA]</color> on our server.\n\n              <color=#0057B7>Take pride in supporting</color> <color=#FFD700>the Ukrainian community!</color>\n\nResource gathering rate <color=#ff4500>x1.9</color>\nComponent gathering rate <color=#ff4500>x1.9</color>\nQuarry gathering rate <color=#ff4500>x1,9</color>\n\nWorkbench works throughout the entire house\nMetabolism.Always wake up well-fed.\nUnbreakable tools.No need to craft dozens of pickaxes and axes anymore - one is enough.(Unbreakable doesn't work in others' builds)\nUnbreakable armor and weapons.\nUnbreakable access cards.You no longer need to stockpile them - just one is enough.\nInfinite diving tank."
            }
            , this);
            lang.RegisterMessages(new Dictionary<string, string> {
                ["MB_Close_Privileges"]
                = "Натисніть на порожнє місце, щоб закрити меню", ["MB_Privileges_Player"] = "ПРИВІЛЕЇ", ["MB_Privileges_Player_2"] = "<color=#FFD700>Бути кращим</color> лекго з VIP!", ["MB_Back"] = "Назад", ["MB_Buy"] = "Купити", ["VIP_Description"] = "Префікс <color=#EFBF00>[VIP]</color> на нашому сервері.\n\n              <color=#0057B7>Пишайтесь своєю підтримкою</color> <color=#FFD700>українського комьюніті!</color>\n\nРейти добування ресурсів <color=#ff4500>x1.3</color>\nРейти добування компонентів <color=#ff4500>x1.3</color>\nРейти добування кар'єрів <color=#ff4500>x1.3</color>\n\nВерстак працює у всьому будинку\nМетаболізм.Прокидайтесь завжди ситими.\nНезламні інструменти.Тож більше не потрібно крафтити десятки кирок та сокир, можна обійтись лише однією.( У чужій білді неломайка не працює )\nНезламна броня та зброя.\nНезламні картки доступу.Тепер вам не потрібно запасатися ними, адже потрібна лише одна.\nНескінченний балон для дайвінгу.", ["PREMIUM_Description"] = "Префікс <color=#410cf0>[PREMIUM]</color> на нашому сервері.\n\n              <color=#0057B7>Пишайтесь своєю підтримкою</color> <color=#FFD700>українського комьюніті!</color>\n\nРейти добування ресурсів <color=#ff4500>x1.5</color>\nРейти добування компонентів <color=#ff4500>x1.5</color>\nРейти добування кар'єрів <color=#ff4500>x1.5</color>\n\nВерстак працює у всьому будинку\nМетаболізм.Прокидайтесь завжди ситими.\nНезламні інструменти.Тож більше не потрібно крафтити десятки кирок та сокир, можна обійтись лише однією.( У чужій білді неломайка не працює )\nНезламна броня та зброя.\nНезламні картки доступу.Тепер вам не потрібно запасатися ними, адже потрібна лише одна.\nНескінченний балон для дайвінгу.", ["DELUXE_Description"] = "Префікс <color=#00ccff>[DELUXE]</color> на нашому сервері.\n\n              <color=#0057B7>Пишайтесь своєю підтримкою</color> <color=#FFD700>українського комьюніті!</color>\n\nРейти добування ресурсів <color=#ff4500>x1.7</color>\nРейти добування компонентів <color=#ff4500>x1.7</color>\nРейти добування кар'єрів <color=#ff4500>x1.7</color>\n\nВерстак працює у всьому будинку\nМетаболізм.Прокидайтесь завжди ситими.\nНезламні інструменти.Тож більше не потрібно крафтити десятки кирок та сокир, можна обійтись лише однією.( У чужій білді неломайка не працює )\nНезламна броня та зброя.\nНезламні картки доступу.Тепер вам не потрібно запасатися ними, адже потрібна лише одна.\nНескінченний балон для дайвінгу.", ["ELITA_Description"] = "Префікс <color=#9d00ff>[ELITA]</color> на нашому сервері.\n\n              <color=#0057B7>Пишайтесь своєю підтримкою</color> <color=#FFD700>українського комьюніті!</color>\n\nРейти добування ресурсів <color=#ff4500>x1.9</color>\nРейти добування компонентів <color=#ff4500>x1.9</color>\nРейти добування кар'єрів <color=#ff4500>x1.9</color>\n\nВерстак працює у всьому будинку\nМетаболізм.Прокидайтесь завжди ситими.\nНезламні інструменти.Тож більше не потрібно крафтити десятки кирок та сокир, можна обійтись лише однією.( У чужій білді неломайка не працює )\nНезламна броня та зброя.\nНезламні картки доступу.Тепер вам не потрібно запасатися ними, адже потрібна лише одна.\nНескінченний балон для дайвінгу."
            }
            , this, "uk");
            lang.RegisterMessages(new Dictionary<string, string> {
                ["MB_Close_Privileges"]
                = "Нажмите на пустое место, чтобы закрыть меню", ["MB_Privileges_Player"] = "ПРИВИЛЕГИИ", ["MB_Privileges_Player_2"] = "<color=#FFD700>Быть лучшим</color> легко с VIP!", ["MB_Back"] = "Назад", ["MB_Buy"] = "Купить", ["VIP_Description"] = "Префикс <color=#EFBF00>[VIP]</color> на нашем сервере.\n\n              <color=#0057B7>Гордитесь своей поддержкой</color> <color=#FFD700>украинского комьюнити!</color>\n\nРейт добычи ресурсов <color=#ff4500>x1.3</color>\nРейт добычи компонентов <color=#ff4500>x1.3</color>\nРейт добычи в карьерах <color=#ff4500>x1.3</color>\n\nВерстак работает во всем доме\nМетаболизм.Просыпайтесь всегда сытыми.\nНеломкие инструменты.Теперь не нужно крафтить десятки кирок и топоров - достаточно одной.(В чужих постройках неуязвимость не работает)\nНеломкая броня и оружие.\nНеломкие карты доступа.Теперь не нужно запасаться ими - нужна всего одна.\nБесконечный баллон для дайвинга.", ["PREMIUM_Description"] = "Префикс <color=#410cf0>[PREMIUM]</color> на нашем сервере.\n\n              <color=#0057B7>Гордитесь своей поддержкой</color> <color=#FFD700>украинского комьюнити!</color>\n\nРейт добычи ресурсов <color=#ff4500>x1.5</color>\nРейт добычи компонентов <color=#ff4500>x1.5</color>\nРейт добычи в карьерах <color=#ff4500>x1.5</color>\n\nВерстак работает во всем доме\nМетаболизм.Просыпайтесь всегда сытыми.\nНеломкие инструменты.Теперь не нужно крафтить десятки кирок и топоров - достаточно одной.(В чужих постройках неуязвимость не работает)\nНеломкая броня и оружие.\nНеломкие карты доступа.Теперь не нужно запасаться ими - нужна всего одна.\nБесконечный баллон для дайвинга.", ["DELUXE_Description"] = "Префикс <color=#00ccff>[DELUXE]</color> на нашем сервере.\n\n              <color=#0057B7>Гордитесь своей поддержкой</color> <color=#FFD700>украинского комьюнити!</color>\n\nРейт добычи ресурсов <color=#ff4500>x1.7</color>\nРейт добычи компонентов <color=#ff4500>x1.7</color>\nРейт добычи в карьерах <color=#ff4500>x1.7</color>\n\nВерстак работает во всем доме\nМетаболизм.Просыпайтесь всегда сытыми.\nНеломкие инструменты.Теперь не нужно крафтить десятки кирок и топоров - достаточно одной.(В чужих постройках неуязвимость не работает)\nНеломкая броня и оружие.\nНеломкие карты доступа.Теперь не нужно запасаться ими - нужна всего одна.\nБесконечный баллон для дайвинга.", ["ELITA_Description"] = "Префикс <color=#9d00ff>[ELITA]</color> на нашем сервере.\n\n              <color=#0057B7>Гордитесь своей поддержкой</color> <color=#FFD700>украинского комьюнити!</color>\n\nРейт добычи ресурсов <color=#ff4500>x1.9</color>\nРейт добычи компонентов <color=#ff4500>x1.9</color>\nРейт добычи в карьерах <color=#ff4500>x1.9</color>\n\nВерстак работает во всем доме\nМетаболизм.Просыпайтесь всегда сытыми.\nНеломкие инструменты.Теперь не нужно крафтить десятки кирок и топоров - достаточно одной.(В чужих постройках неуязвимость не работает)\nНеломкая броня и оружие.\nНеломкие карты доступа.Теперь не нужно запасаться ими - нужна всего одна.\nБесконечный баллон для дайвинга."
            }
            , this, "ru");
        }
        private string Msg(string key, string userid = null, params object[] obj) {
            return string.Format(lang.GetMessage(key, this, userid), obj);
        }
#endregion
    }
}

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

Другие ресурсы пользователя 15FPS

Сверху