This is a mobile optimized page that loads fast, if you want to load the real page, click this text.

Вопрос Помощь с dlc

JerryMorality

Начинающий специалист
Автор темы
2 Сен 2022
71
6
49
В общем захотел добавить кастомные броники всем фракциям но теперь не пойму как правильно и где их прописать, нашел кейс с брониками скину код если это то место то подскажите как правильно прописать кастомные модели из dlc


C#:
case ItemType.BodyArmor:
                        {
                            if (item.IsActive)
                            {
                                item.Data = player.Armor.ToString();
                                player.Armor = 0;
                                player.ResetSharedData("HASARMOR");
                                Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 0;
                                Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 0;
                                player.SetClothes(9, Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation, Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture);
                                nInventory.Items[UUID][index].IsActive = false;
                                GUI.Dashboard.Update(player, item, index);
                            }
                            else
                            {
                                var armor = Convert.ToInt32((string)item.Data);
                                player.Armor = armor;
                                player.SetSharedData("HASARMOR", true);
                                switch (Main.Players[player].FractionID)
                                {
                                    case 0:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 6;
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 1:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 0;
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 2:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 2;
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 3:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 1;
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 4:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 5;
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 5:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 4;
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 6:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 8;
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 7:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 2;
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 16;
                                        break;
                                    case 8:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 7; //EMS
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 9:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 9; //FBI
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 10:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 7; //Мафия 1
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 11:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 7; //Мафия 2
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 12:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 8; //Мафия 3
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 13:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 4; //Мафия 4
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 14:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 0;
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 16;
                                        break;
                                    case 15:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 6;
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;
                                    case 18:
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture = 9; // Групп6
                                        Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation = 28;
                                        break;

                                }
                                player.SetClothes(9, Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Variation, Customization.CustomPlayerData[Main.Players[player].UUID].Clothes.Bodyarmor.Texture);
                                nInventory.UnActiveItem(player, item.Type);
                                nInventory.Items[UUID][index].IsActive = true;
                                GUI.Dashboard.Update(player, item, index);
                            }
                            return;
                        }


Название моделей из dlc
 

XDeveluxe

Модератор
Команда форума
high coder
30 Авг 2021
2,220
1,425
191
27
Любая одежда выдаётся через индекс и вариацию. Найди под каким индексом и вариацией находятся именно твои кастомные броники.
Мы, посмотрев на названия ytd, никаким образом это тебе не сможем узнать.
 

JerryMorality

Начинающий специалист
Автор темы
2 Сен 2022
71
6
49
а как искать впервые такое делаю?
 

XDeveluxe

Модератор
Команда форума
high coder
30 Авг 2021
2,220
1,425
191
27
а как искать впервые такое делаю?
Ну, из простейших - зайти на сервер, использовать команду выдачи временной одежды, перебирать, пока не найдёшь свои броники. Потом запомнить индекс и вариацию.

На редейдже-основанных модах была команда /sc, если я не ошибаюсь, которая не выдает одежду в инвентарь, а просто отображает на тебе. Попробуй с помощью неё.
 
Реакции: Inoi

JerryMorality

Начинающий специалист
Автор темы
2 Сен 2022
71
6
49
спасибо