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
victortreval

Как задать сет лута для новых игроков зашедших на сервер?

Доброго времени всем читающим. Опять обращаюсь за помощью к знающим людям за инструкцией если таковая есть. 
Суть вопроса такова - как, что и где написать чтоб прописать стартовый лут новому игроку который только зашел на сервер. 
Посмотрел несколько роликов - никакого эффекта. Прочитал немного форум и информация 18-го года или 22 что на вряд ли работает с нынешней версией 1.21
По сути я понимаю что можно создать скорее всего сет в файле init находящегося по пути S:\SteamLibrary\steamapps\common\DayZServer\mpmissions\dayzOffline.chernarusplus\init.c 
но насколько я помню он иногда обновляется и все строки которые там были добавлены стираются что не очень хорошо. 
Подскажите. Как и где  можно прописать сеты стартовых предметов для новых игроков? 
И забегая вперед как можно прописать сет конкретному игроку прописав его ID?
Очень буду рад болванкам которые можно редактировать под себя.
P.S Простите если не смог найти актуальный гайд на форуме. Искал но нашел только старое. 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
class CustomMission: MissionServer
{
	void SetRandomHealth(EntityAI itemEnt)
	{
		if ( itemEnt )
		{
			int rndHlt = Math.RandomInt(55,100);
			itemEnt.SetHealth("","",rndHlt);
		}
	}

	override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
	{
		Entity playerEnt;
		playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
		Class.CastTo(m_player, playerEnt);

		GetGame().SelectPlayer(identity, m_player);

		return m_player;
	}

	override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		player.RemoveAllItems();
		EntityAI itemTop;
		EntityAI itemEnt;
		ItemBase itemBs;
		float rand;

		itemTop = player.FindAttachmentBySlotName("Body");


			SetRandomHealth(itemEnt);

			string hatArray[] = { "ZmijovkaCap_Green", "ZmijovkaCap_Brown", "ZmijovkaCap_Blue", "BeanieHat_Grey", "BeanieHat_Brown", "BeanieHat_Blue", "BaseballCap_Olive", "BaseballCap_Black", "BeanieHat_Beige", "BaseballCap_Beige", "BaseballCap_Blue" };
			int rndIndex = Math.RandomInt(0, 11);
			itemEnt = player.GetInventory().CreateInInventory(hatArray[rndIndex]);
			
			string bodyArray[] = { "Sweater_Gray", "Sweater_Blue", "Sweater_Green", "Shirt_BlueCheck", "Shirt_BlueCheckBright", "Shirt_GreenCheck", "Shirt_WhiteCheck", "Shirt_PlaneBlack", "Hoodie_Black", "Hoodie_Brown", "Hoodie_Green", "WoolCoat_BlackCheck", "WoolCoat_BlueCheck", "WoolCoat_GreyCheck", "WoolCoat_BrownCheck", "Hoodie_Grey" };
			int rnd1Index = Math.RandomInt(0, 16);
			itemEnt = player.GetInventory().CreateInInventory(bodyArray[rnd1Index]);
			
			string pantsArray[] = { "Jeans_Black", "Jeans_Blue", "Jeans_Brown", "Jeans_Green", "Jeans_Grey", "Jeans_BlueDark" };
			int rnd2Index = Math.RandomInt(0, 6);
			itemEnt = player.GetInventory().CreateInInventory(pantsArray[rnd2Index]);
			
			string legArray[] = { "AthleticShoes_Blue", "AthleticShoes_Black", "AthleticShoes_Brown", "AthleticShoes_Green", "AthleticShoes_Grey", "HikingBoots_Brown", "HikingBoots_Black", "HikingBootsLow_Black", "HikingBootsLow_Blue", "HikingBootsLow_Beige", "HikingBootsLow_Grey" };
			int rnd3Index = Math.RandomInt(0, 11);
			itemEnt = player.GetInventory().CreateInInventory(legArray[rnd3Index]);
			SetRandomHealth(itemEnt);
			
			string KnifeArray[] = { "HuntingKnife" };
			int rnd4Index = Math.RandomInt(0, 1);
			itemEnt = player.GetInventory().CreateInInventory(KnifeArray[rnd4Index]);
			SetRandomHealth(itemEnt);

			player.GetInventory().CreateInInventory("WaterBottle");
			player.GetInventory().CreateInInventory("PersonalRadio");
            player.GetInventory().CreateInInventory("Battery9V");
			player.GetInventory().CreateInInventory("Chemlight_White");
			player.GetInventory().CreateInInventory("BandageDressing");
			player.GetInventory().CreateInInventory("Pajka");
			player.GetInventory().CreateInInventory("AmmoBox_00buck_10rnd");
			player.GetInventory().CreateInInventory("AmmoBox_00buck_10rnd");
			player.GetInventory().CreateInInventory("AmmoBox_00buck_10rnd");
			player.GetInventory().CreateInInventory("air_weapon_izh43_sawedoff");
			
			SetRandomHealth(itemEnt);
	}
};

 

В инит

 

Share this post


Link to post
Share on other sites



  • 0

А он не пропадет после обновления ?? Просто я слышал что все что там прописывается после обновления стирается. 

И я могу тут прописать отдельных игрок в этом файле ?? 

Share this post


Link to post
Share on other sites
  • 0
5 часов назад, victortreval сказал:

А он не пропадет после обновления ?? Просто я слышал что все что там прописывается после обновления стирается. 

И я могу тут прописать отдельных игрок в этом файле ?? 

Года 3 вроде бы работает не чего не пропадает

 

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.