Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
Sign in to follow this  
Maks86

Выдача лута игроку красивым способом

Подскажите. Возможно ли вообще выдать лут, но так чтоб он не хаотично распределялся в инвентаре а както его упорядочить красиво.

n = 0; while (n < 2){n++; itemCreated = player.GetInventory().CreateInInventory("BandageDressing");}				// Выдаем игроку Бинт
itemCreated = player.GetInventory().CreateInInventory("Morphine");													// Выдаем игроку Морфин
itemCreated = player.GetInventory().CreateInInventory("Epinephrine");												// Выдаем игроку Адриналин
itemCreated = player.GetInventory().CreateInInventory("TacticalGoggles");											// Выдаем игроку Такические очки
itemCreated = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");									// Выдаем игроку Бекон - открытый
if (random_top_food == 1)
	{n = 0; while (n < 3){n++; itemCreated = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");}	// Выдаем игроку дополнительно Бекон - открытый
n = 0; while (n < 2){n++; itemCreated = player.GetInventory().CreateInInventory("WaterBottle");}}					// Выдаем игроку дополнительно Бутылку с водой
if (random_surv_type > 1){itemCreated = player.GetInventory().CreateInInventory("WaterBottle");}					// Выдаем игроку Бутылку с водой
itemCreated = player.GetInventory().CreateInInventory("PurificationTablets");										// Выдаем игроку Хлорные таблетки
itemCreated = player.GetInventory().CreateInInventory("CharcoalTablets");											// Выдаем игроку Активированный уголь
n = 0; while (n < 2){n++; itemCreated = player.GetInventory().CreateInInventory("Heatpack");}						// Выдаем игроку Грелки
itemCreated = player.GetInventory().CreateInInventory("Battery9V");													// Выдаем игроку Батарейка
itemCreated = player.GetInventory().CreateInInventory("SalineBagIV");												// Выдаем игроку Комплект физраствора
if (y == 1) {itemCreated = player.GetInventory().CreateInInventory("ImprovisedSuppressor");}						// Выдаем самодельный глушитель

У меня примерно вот таким способом все выдаётся. У меня 12 сетов игроков, после выдачи сета и оружия с патронами, выдаю остальной лут.

Лут распределяется хаотично, остаётся много места свободного не используемого.  Заранее както прописать не могу, так как сеты все разные, разная одежда итд. Хотелось бы хотябы понять, если я выдал сет, то как можно выдать лут например так. 

1. Если есть жилет, то в него патроны с обоймами

2. В куртку, например еду и хрень всякую.

3. В штаны, бинты

4. В рюкзак, все что габаритное.

 

Ну в общем таким образом, возможно, както лут переворачивать или конкретно указывать место в инвентаре, прям на сетке где он должен располагаться.

 

Подскажите? 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Можно, я себе вот так прописал, там где написано Body и Legs, тобишь тело и ноги, туда и будет попадать лут который прописан в моем случае с определенным шансом появления

itemClothing = player.FindAttachmentBySlotName( "Body" );
        if ( itemClothing )
        {
            SetRandomHealth( itemClothing ); //  ВЕЩИ
            itemEnt = player.GetInventory().CreateInInventory( "Colt1911" ); // ПИСТОЛЕТ ГЛОК 19
            itemEnt = player.GetInventory().CreateInInventory( "Mag_1911_7Rnd" ); // ОБОЙМА 
            itemEnt = player.GetInventory().CreateInInventory( "Ammo_45ACP" ); // ПАТРОНЫ 45ACP
            itemEnt = player.GetInventory().CreateInInventory( "HuntingKnife" ); // ОХОТНИЧИЙ НОЖ
            itemEnt = player.GetInventory().CreateInInventory( "BaseballCap_Black" ); // ЧЕРНАЯ КЕПКА
            itemEnt = player.GetInventory().CreateInInventory( "FurCourierBag" ); // РЮКЗАК ИЗ МЕШКОВИНЫ
            if ( Class.CastTo( itemBs, itemEnt ) )
                itemBs.SetQuantity( 1 );

            string chemlightArray[] = { "Chemlight_White", "Chemlight_Yellow", "Chemlight_Green", "Chemlight_Red" };
            int rndIndex = Math.RandomInt( 0, 4 );
            itemEnt = itemClothing.GetInventory().CreateInInventory( chemlightArray[rndIndex] );
            SetRandomHealth( itemEnt );

            rand = Math.RandomFloatInclusive( 0.0, 1.0 );
            if ( rand > 0.15 )
                itemEnt = player.GetInventory().CreateInInventory( "Hatchet" ); // ТОПОР
            if ( rand > 0.35 )
                itemEnt = player.GetInventory().CreateInInventory( "TetracyclineAntibiotics" ); // АНТИБИОТИКИ 
                itemEnt = player.GetInventory().CreateInInventory( "CharcoalTablets" ); // АКТИВИРОВАННЫЙ УГОЛЬ
            if ( rand > 0.50 )
                itemEnt = player.GetInventory().CreateInInventory( "SodaCan_Cola" ); // КОЛА
                itemEnt = player.GetInventory().CreateInInventory( "Plum" ); // СЛИВА
            if ( rand > 0.75 )
                itemEnt = player.GetInventory().CreateInInventory( "WaterBottle" ); // БУТЫЛКА ВОДЫ
                itemEnt = player.GetInventory().CreateInInventory( "BakedBeansCan" ); // КОНСЕРВЫ
            if ( rand > 1.0 )
                itemEnt = player.GetInventory().CreateInInventory( "BandageDressing" ); // БИНТ
                itemEnt = player.GetInventory().CreateInInventory( "Flashlight" ); // ФОНАРИК
            SetRandomHealth( itemEnt );
        }
        
        itemClothing = player.FindAttachmentBySlotName( "Legs" );
        if ( itemClothing )
            SetRandomHealth( itemClothing );
            itemEnt = player.GetInventory().CreateInInventory( "Matchbox" ); // СПИЧКИ
            itemEnt = player.GetInventory().CreateInInventory( "Battery9V" ); // БАТАРЕЙКА 9V
            if ( Class.CastTo( itemBs, itemEnt ) )
                itemBs.SetQuantity( 1 );
        
        itemClothing = player.FindAttachmentBySlotName( "Feet" );
    }
};

 

Edited by 123new
вставка кода в спец тег для вставки (see edit history)

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.