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
Kombinat

пропись сетов в init.c и их разделы

image.png.b2f60e44d4d40d00f55382d964a4ac7f.png
Дефолтный init.c конфиг
Как я понимаю шмотка выбирается из определенного раздела где написаны эти же шмотки. Хочу сделать определенные сеты для новичков и для некоторых игроков, как я могу это сделать?
 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

поумолчанию стартовые шмотки типа штанов, футболки и т.п. на игроке уже на этот момент времени, они определяются настройками игрока в его главном меню.

От сервера вы их не можете определить так как при вызове этой функции они уже есть на игроке.

НО вы можете уделать все с игрока и выдать заного так как вам надо.

Как выдавать - то уже решайте сами. Можете сами написать код, а можете воспользоваться готовым скриптиком

который также надо будет настроить и дописать своим сетом.

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

Share this post


Link to post
Share on other sites



  • 0
Posted (edited)

@Kombinat  в init.c замени override void StartingEquipSetup на ниже указанный код и редактируй вещи как тебе нужно, а если ты хочешь настроить индивидуальный лут определенным игрокам то иди по ссылке указанной @123new.
p.s.  после строк // Иж-43 идет закомментированный ванильный код можешь его просто удалить начиная от /* и заканчивая */

override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		player.RemoveAllItems();
		
		//EntityAI itemClothing;
		EntityAI itemEnt;
		ItemBase itemBs;
		
		//float rand;
		// Куртка
		itemEnt = player.GetInventory().CreateInInventory("TacticalShirt_Tan");
		itemBs = ItemBase.Cast(itemEnt);
		// Штаны
		itemEnt = player.GetInventory().CreateInInventory("CargoPants_Beige");
		itemBs = ItemBase.Cast(itemEnt);
		// Рюкзак
		itemEnt = player.GetInventory().CreateInInventory("TortillaBag");
		itemBs = ItemBase.Cast(itemEnt);
		// Кепка
		itemEnt = player.GetInventory().CreateInInventory("BaseballCap_Beige");
		itemBs = ItemBase.Cast(itemEnt);
		// Перчатки
		itemEnt = player.GetInventory().CreateInInventory("HandsCover_Improvised");
		itemBs = ItemBase.Cast(itemEnt);
		// Обувь
		itemEnt = player.GetInventory().CreateInInventory("HikingBoots_Brown");
		itemBs = ItemBase.Cast(itemEnt);
		// Маска
		itemEnt = player.GetInventory().CreateInInventory("NioshFaceMask");
		itemBs = ItemBase.Cast(itemEnt);
		// Тряпка
		itemEnt = player.GetInventory().CreateInInventory("Rag");
		itemBs = ItemBase.Cast(itemEnt);
		// Рис
		itemEnt = player.GetInventory().CreateInInventory("Rice");
		itemBs = ItemBase.Cast(itemEnt);
		// Патроны 12
		itemEnt = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
		itemBs = ItemBase.Cast(itemEnt);
		// Патроны 12
		itemEnt = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
		itemBs = ItemBase.Cast(itemEnt);
		// Кабачок
		itemEnt = player.GetInventory().CreateInInventory("Zucchini");
		itemBs = ItemBase.Cast(itemEnt);
		// Бутылка
		itemEnt = player.GetInventory().CreateInInventory("WaterBottle");
		itemBs = ItemBase.Cast(itemEnt);
		// Нож
		itemEnt = player.GetInventory().CreateInInventory("BoneKnife");
		itemBs = ItemBase.Cast(itemEnt);
		// Иж-43
		itemEnt = player.GetInventory().CreateInInventory("Izh43Shotgun");
		itemBs = ItemBase.Cast(itemEnt);
	/*	itemClothing = player.FindAttachmentBySlotName( "Body" );
		if ( itemClothing )
		{
			SetRandomHealth( itemClothing );
			
			itemEnt = itemClothing.GetInventory().CreateInInventory( "Zucchini" );
			
			
			if ( Class.CastTo( itemBs, itemEnt ) )
				itemBs.SetQuantity( 2 );

			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.35 )
				itemEnt = player.GetInventory().CreateInInventory( "Apple" );
			else if ( rand > 0.65 )
				itemEnt = player.GetInventory().CreateInInventory( "Pear" );
			else
				itemEnt = player.GetInventory().CreateInInventory( "Plum" );

			SetRandomHealth( itemEnt );
		}
		
		itemClothing = player.FindAttachmentBySlotName( "Legs" );
		if ( itemClothing )
			SetRandomHealth( itemClothing );
		
		itemClothing = player.FindAttachmentBySlotName( "Feet" ); 
	*/
	}


 

Edited by alex_good_kaban (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

×
×
  • 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.