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
iSuss

Проблемы с рандомным стартовым лутом

Прописал в init.c рандомизацию лута, тоесть при таком то значении такой то лут, только вот не запускается сервер, при считывании файла ошибки выдает, может кто поймет, где я накосячил))

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

        itemTop = player.FindAttachmentBySlotName("Body");

        if ( itemTop )
        {
            itemEnt = itemTop.GetInventory().CreateInInventory("Bandage");
            if ( Class.CastTo(itemBs, itemEnt ) )
                itemBs.SetQuantity(3);
            itemEnt = itemTop.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
            if ( Class.CastTo(itemBs, itemEnt ) )
                itemBs.SetQuantity(1);
            itemEnt = itemTop.GetInventory().CreateInInventory("Canteen");
            if ( Class.CastTo(itemBs, itemEnt ) )
                itemBs.SetQuantity(1);
            itemEnt = itemTop.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
            if ( Class.CastTo(itemBs, itemEnt ) )
                itemBs.SetQuantity(2);
            itemEnt = itemTop.GetInventory().CreateInInventory("M67Grenade");
            if ( Class.CastTo(itemBs, itemEnt ) )
                itemBs.SetQuantity(2);
            itemEnt = itemTop.GetInventory().CreateInInventory("Morphine");
            if ( Class.CastTo(itemBs, itemEnt ) )
                itemBs.SetQuantity(2);
            itemEnt = itemTop.GetInventory().CreateInInventory("Epinephrine");
            if ( Class.CastTo(itemBs, itemEnt ) )
                itemBs.SetQuantity(2);

            SetRandomHealth(itemEnt);

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

            rand = Math.RandomFloatInclusive(0.0, 1.0);
            if ( rand < 0.1 )
                itemEnt = player.GetInventory().CreateInInventory("FAL");
                itemEnt = player.GetInventory().CreateInInventory("Fal_OeBttstck");
                itemEnt = player.GetInventory().CreateInInventory("ACOGOptic");
                itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
                if ( Class.CastTo(itemBs, itemEnt ) )
                    itemBs.SetQuantity(6);
            
            else if ( rand 0.1 < 0.2 )
                itemEnt = player.GetInventory().CreateInInventory("B95");
                itemEnt = player.GetInventory().CreateInInventory("HuntingOptic");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
                
            else if ( rand 0.2 < 0.3 )
                itemEnt = player.GetInventory().CreateInInventory("AK74");
                itemEnt = player.GetInventory().CreateInInventory("AK_WoodBttstck");
                itemEnt = player.GetInventory().CreateInInventory("AK74_Hndgrd");
                itemEnt = player.GetInventory().CreateInInventory("AK_Suppressor");
                itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
                if ( Class.CastTo(itemBs, itemEnt ) )
                    itemBs.SetQuantity(6);
                
            else if ( rand 0.3 < 0.4 )
                itemEnt = player.GetInventory().CreateInInventory("MP5K");
                itemEnt = player.GetInventory().CreateInInventory("MP5_PlasticHndgrd");
                itemEnt = player.GetInventory().CreateInInventory("MP5k_StockBttstck");
                itemEnt = player.GetInventory().CreateInInventory("ReflexOptic");
                itemEnt = player.GetInventory().CreateInInventory("Battery9V");
                itemEnt = player.GetInventory().CreateInInventory("PistolSuppressor");
                itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
                if ( Class.CastTo(itemBs, itemEnt ) )
                    itemBs.SetQuantity(6);
                
            else if ( rand 0.4 < 0.5 )
                itemEnt = player.GetInventory().CreateInInventory("CZ61");
                itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
                if ( Class.CastTo(itemBs, itemEnt ) )
                    itemBs.SetQuantity(6);
                
            else if ( rand 0.5 < 0.6 )
                itemEnt = player.GetInventory().CreateInInventory("Winchester70");
                itemEnt = player.GetInventory().CreateInInventory("HuntingOptic");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
            
            else if ( rand 0.6 < 0.7 )
                itemEnt = player.GetInventory().CreateInInventory("Mosin9130");
                itemEnt = player.GetInventory().CreateInInventory("Mosin_Compensator");
                itemEnt = player.GetInventory().CreateInInventory("PUScopeOptic");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
                
            else if ( rand 0.7 < 0.8 )
                itemEnt = player.GetInventory().CreateInInventory("Colt1911");
                itemEnt = player.GetInventory().CreateInInventory("PistolSuppressor");
                itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
                if ( Class.CastTo(itemBs, itemEnt ) )
                    itemBs.SetQuantity(9);
                
            else if ( rand 0.8 < 0.9 )
                itemEnt = player.GetInventory().CreateInInventory("Izh18");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
                itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
                
            else if ( rand 0.9 < 1.0 )
                itemEnt = player.GetInventory().CreateInInventory("CZ527");
                itemEnt = player.GetInventory().CreateInInventory("HuntingOptic");
                itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
                if ( Class.CastTo(itemBs, itemEnt ) )
                    itemBs.SetQuantity(9);
            }
        }
    }
};

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Edited by 123new (see edit history)

Share this post


Link to post
Share on other sites

18 answers to this question

Recommended Posts

  • 0

Скинте файле гляну где ошибка + у вас как я вижу ошибка в init 

Edited by Banda (see edit history)

Share this post


Link to post
Share on other sites



  • 0

1210750287_.png.dfe9de90d37cdbe9a545ff7ee7fddebe.png

не уверен что вот эти условия корректны

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

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

Share this post


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

Скинте файле гляну где ошибка + у вас как я вижу ошибка в init 

Вот файл

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Share this post


Link to post
Share on other sites
  • 0

Че за нафиг?

if (rand 0.1 < 0.2)

 

Если перед этим  rand = Math.RadomFloatInclusive(0.0, 1.0)

Тогда

if (rand < 0.1)

 

 

Share this post


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

Вот файл

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

как и сказал, с условии и в скобочке дело. Тогда уж вот так, если сильно хотите

void main()
{
	//INIT WEATHER BEFORE ECONOMY INIT------------------------
	Weather weather = g_Game.GetWeather();

	weather.MissionWeather(false);    // false = use weather controller from Weather.c

	weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
	weather.GetRain().Set( 0, 0, 1);
	weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);

	//INIT ECONOMY--------------------------------------
	Hive ce = CreateHive();
	if ( ce )
		ce.InitOffline();

	//DATE RESET AFTER ECONOMY INIT-------------------------
	int year, month, day, hour, minute;
	int reset_month = 9, reset_day = 20;
	GetGame().GetWorld().GetDate(year, month, day, hour, minute);

	if ((month == reset_month) && (day < reset_day))
	{
		GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
	}
	else
	{
		if ((month == reset_month + 1) && (day > reset_day))
		{
			GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
		}
		else
		{
			if ((month < reset_month) || (month > reset_month + 1))
			{
				GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
			}
		}
	}
}

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)
	{
		EntityAI itemTop;
		EntityAI itemEnt;
		ItemBase itemBs;

		itemTop = player.FindAttachmentBySlotName("Body");

		if ( itemTop )
		{
			itemEnt = itemTop.GetInventory().CreateInInventory("Bandage");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(3);
			itemEnt = itemTop.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(1);
			itemEnt = itemTop.GetInventory().CreateInInventory("Canteen");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(1);
			itemEnt = itemTop.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(2);
			itemEnt = itemTop.GetInventory().CreateInInventory("M67Grenade");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(2);
			itemEnt = itemTop.GetInventory().CreateInInventory("Morphine");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(2);
			itemEnt = itemTop.GetInventory().CreateInInventory("Epinephrine");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(2);

			SetRandomHealth(itemEnt);

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

			
		}			
		itemClothing = player.FindAttachmentBySlotName( "Legs" );
		if ( itemClothing )
			SetRandomHealth( itemClothing );
		
		itemClothing = player.FindAttachmentBySlotName( "Feet" );
		if ( itemClothing )
			SetRandomHealth( itemClothing );
			
		//___________ My Sets START ____________
		float rand = Math.RandomFloatInclusive(0.0, 1.0);
			if ( rand < 0.1 )
			{
				itemEnt = player.GetInventory().CreateInInventory("FAL");
				itemEnt = player.GetInventory().CreateInInventory("Fal_OeBttstck");
				itemEnt = player.GetInventory().CreateInInventory("ACOGOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(6);
			}
			if (( rand >= 0.1) && (rand < 0.2 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("B95");
				itemEnt = player.GetInventory().CreateInInventory("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
			}	
			if (( rand >= 0.2) && (rand < 0.3 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("AK74");
				itemEnt = player.GetInventory().CreateInInventory("AK_WoodBttstck");
				itemEnt = player.GetInventory().CreateInInventory("AK74_Hndgrd");
				itemEnt = player.GetInventory().CreateInInventory("AK_Suppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(6);
			}
			if (( rand >= 0.3) && (rand < 0.4 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("MP5K");
				itemEnt = player.GetInventory().CreateInInventory("MP5_PlasticHndgrd");
				itemEnt = player.GetInventory().CreateInInventory("MP5k_StockBttstck");
				itemEnt = player.GetInventory().CreateInInventory("ReflexOptic");
				itemEnt = player.GetInventory().CreateInInventory("Battery9V");
				itemEnt = player.GetInventory().CreateInInventory("PistolSuppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(6);
			}
			if (( rand >= 0.4) && (rand < 0.5 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("CZ61");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(6);
			}
			if (( rand >= 0.5) && (rand < 0.6 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("Winchester70");
				itemEnt = player.GetInventory().CreateInInventory("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
			}
			if (( rand >= 0.6) && (rand < 0.7 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("Mosin9130");
				itemEnt = player.GetInventory().CreateInInventory("Mosin_Compensator");
				itemEnt = player.GetInventory().CreateInInventory("PUScopeOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
			}
			if (( rand >= 0.7) && (rand < 0.8 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("Colt1911");
				itemEnt = player.GetInventory().CreateInInventory("PistolSuppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(9);
			}
			if (( rand >= 0.8) && (rand < 0.9 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("Izh18");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
			}
			if (( rand >= 0.9) && (rand < 1.0 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("CZ527");
				itemEnt = player.GetInventory().CreateInInventory("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(9);
			}
		//___________ My Sets END ____________
	}
}

Mission CreateCustomMission(string path)
{
	return new CustomMission();
}

но как по мне, проще было бы целочисленное число генерировать, и из него исходить по условию или блоку switch-case, так хоть ограничений бы не было в размете от 0.0 до 1.0

Share this post


Link to post
Share on other sites
  • 0
1 час назад, 123new сказал:

как и сказал, с условии и в скобочке дело. Тогда уж вот так, если сильно хотите

void main() { //INIT WEATHER BEFORE ECONOMY INIT------------------------ Weather weather = g_Game.GetWeather(); weather.MissionWeather(false); // false = use weather controller from Weather.c weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0); weather.GetRain().Set( 0, 0, 1); weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0); //INIT ECONOMY-------------------------------------- Hive ce = CreateHive(); if ( ce ) ce.InitOffline(); //DATE RESET AFTER ECONOMY INIT------------------------- int year, month, day, hour, minute; int reset_month = 9, reset_day = 20; GetGame().GetWorld().GetDate(year, month, day, hour, minute); if ((month == reset_month) && (day < reset_day)) { GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute); } else { if ((month == reset_month + 1) && (day > reset_day)) { GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute); } else { if ((month < reset_month) || (month > reset_month + 1)) { GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute); } } } } 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) { EntityAI itemTop; EntityAI itemEnt; ItemBase itemBs; itemTop = player.FindAttachmentBySlotName("Body"); if ( itemTop ) { itemEnt = itemTop.GetInventory().CreateInInventory("Bandage"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(3); itemEnt = itemTop.GetInventory().CreateInInventory("TacticalBaconCan_Opened"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(1); itemEnt = itemTop.GetInventory().CreateInInventory("Canteen"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(1); itemEnt = itemTop.GetInventory().CreateInInventory("M18SmokeGrenade_Purple"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(2); itemEnt = itemTop.GetInventory().CreateInInventory("M67Grenade"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(2); itemEnt = itemTop.GetInventory().CreateInInventory("Morphine"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(2); itemEnt = itemTop.GetInventory().CreateInInventory("Epinephrine"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(2); SetRandomHealth(itemEnt); string chemlightArray[] = { "Chemlight_White", "Chemlight_Yellow", "Chemlight_Green", "Chemlight_Red" }; int rndIndex = Math.RandomInt(0, 4); itemEnt = itemTop.GetInventory().CreateInInventory(chemlightArray[rndIndex]); SetRandomHealth(itemEnt); } itemClothing = player.FindAttachmentBySlotName( "Legs" ); if ( itemClothing ) SetRandomHealth( itemClothing ); itemClothing = player.FindAttachmentBySlotName( "Feet" ); if ( itemClothing ) SetRandomHealth( itemClothing ); //___________ My Sets START ____________ float rand = Math.RandomFloatInclusive(0.0, 1.0); if ( rand < 0.1 ) { itemEnt = player.GetInventory().CreateInInventory("FAL"); itemEnt = player.GetInventory().CreateInInventory("Fal_OeBttstck"); itemEnt = player.GetInventory().CreateInInventory("ACOGOptic"); itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(6); } if (( rand >= 0.1) && (rand < 0.2 )) { itemEnt = player.GetInventory().CreateInInventory("B95"); itemEnt = player.GetInventory().CreateInInventory("HuntingOptic"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); } if (( rand >= 0.2) && (rand < 0.3 )) { itemEnt = player.GetInventory().CreateInInventory("AK74"); itemEnt = player.GetInventory().CreateInInventory("AK_WoodBttstck"); itemEnt = player.GetInventory().CreateInInventory("AK74_Hndgrd"); itemEnt = player.GetInventory().CreateInInventory("AK_Suppressor"); itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(6); } if (( rand >= 0.3) && (rand < 0.4 )) { itemEnt = player.GetInventory().CreateInInventory("MP5K"); itemEnt = player.GetInventory().CreateInInventory("MP5_PlasticHndgrd"); itemEnt = player.GetInventory().CreateInInventory("MP5k_StockBttstck"); itemEnt = player.GetInventory().CreateInInventory("ReflexOptic"); itemEnt = player.GetInventory().CreateInInventory("Battery9V"); itemEnt = player.GetInventory().CreateInInventory("PistolSuppressor"); itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(6); } if (( rand >= 0.4) && (rand < 0.5 )) { itemEnt = player.GetInventory().CreateInInventory("CZ61"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(6); } if (( rand >= 0.5) && (rand < 0.6 )) { itemEnt = player.GetInventory().CreateInInventory("Winchester70"); itemEnt = player.GetInventory().CreateInInventory("HuntingOptic"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); } if (( rand >= 0.6) && (rand < 0.7 )) { itemEnt = player.GetInventory().CreateInInventory("Mosin9130"); itemEnt = player.GetInventory().CreateInInventory("Mosin_Compensator"); itemEnt = player.GetInventory().CreateInInventory("PUScopeOptic"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54"); } if (( rand >= 0.7) && (rand < 0.8 )) { itemEnt = player.GetInventory().CreateInInventory("Colt1911"); itemEnt = player.GetInventory().CreateInInventory("PistolSuppressor"); itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(9); } if (( rand >= 0.8) && (rand < 0.9 )) { itemEnt = player.GetInventory().CreateInInventory("Izh18"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39"); } if (( rand >= 0.9) && (rand < 1.0 )) { itemEnt = player.GetInventory().CreateInInventory("CZ527"); itemEnt = player.GetInventory().CreateInInventory("HuntingOptic"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd"); if ( Class.CastTo(itemBs, itemEnt ) ) itemBs.SetQuantity(9); } //___________ My Sets END ____________ } } Mission CreateCustomMission(string path) { return new CustomMission(); }


void main()
{
	//INIT WEATHER BEFORE ECONOMY INIT------------------------
	Weather weather = g_Game.GetWeather();

	weather.MissionWeather(false);    // false = use weather controller from Weather.c

	weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
	weather.GetRain().Set( 0, 0, 1);
	weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);

	//INIT ECONOMY--------------------------------------
	Hive ce = CreateHive();
	if ( ce )
		ce.InitOffline();

	//DATE RESET AFTER ECONOMY INIT-------------------------
	int year, month, day, hour, minute;
	int reset_month = 9, reset_day = 20;
	GetGame().GetWorld().GetDate(year, month, day, hour, minute);

	if ((month == reset_month) && (day < reset_day))
	{
		GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
	}
	else
	{
		if ((month == reset_month + 1) && (day > reset_day))
		{
			GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
		}
		else
		{
			if ((month < reset_month) || (month > reset_month + 1))
			{
				GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
			}
		}
	}
}

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)
	{
		EntityAI itemTop;
		EntityAI itemEnt;
		ItemBase itemBs;

		itemTop = player.FindAttachmentBySlotName("Body");

		if ( itemTop )
		{
			itemEnt = itemTop.GetInventory().CreateInInventory("Bandage");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(3);
			itemEnt = itemTop.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(1);
			itemEnt = itemTop.GetInventory().CreateInInventory("Canteen");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(1);
			itemEnt = itemTop.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(2);
			itemEnt = itemTop.GetInventory().CreateInInventory("M67Grenade");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(2);
			itemEnt = itemTop.GetInventory().CreateInInventory("Morphine");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(2);
			itemEnt = itemTop.GetInventory().CreateInInventory("Epinephrine");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(2);

			SetRandomHealth(itemEnt);

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

			
		}			
		itemClothing = player.FindAttachmentBySlotName( "Legs" );
		if ( itemClothing )
			SetRandomHealth( itemClothing );
		
		itemClothing = player.FindAttachmentBySlotName( "Feet" );
		if ( itemClothing )
			SetRandomHealth( itemClothing );
			
		//___________ My Sets START ____________
		float rand = Math.RandomFloatInclusive(0.0, 1.0);
			if ( rand < 0.1 )
			{
				itemEnt = player.GetInventory().CreateInInventory("FAL");
				itemEnt = player.GetInventory().CreateInInventory("Fal_OeBttstck");
				itemEnt = player.GetInventory().CreateInInventory("ACOGOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(6);
			}
			if (( rand >= 0.1) && (rand < 0.2 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("B95");
				itemEnt = player.GetInventory().CreateInInventory("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
			}	
			if (( rand >= 0.2) && (rand < 0.3 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("AK74");
				itemEnt = player.GetInventory().CreateInInventory("AK_WoodBttstck");
				itemEnt = player.GetInventory().CreateInInventory("AK74_Hndgrd");
				itemEnt = player.GetInventory().CreateInInventory("AK_Suppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(6);
			}
			if (( rand >= 0.3) && (rand < 0.4 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("MP5K");
				itemEnt = player.GetInventory().CreateInInventory("MP5_PlasticHndgrd");
				itemEnt = player.GetInventory().CreateInInventory("MP5k_StockBttstck");
				itemEnt = player.GetInventory().CreateInInventory("ReflexOptic");
				itemEnt = player.GetInventory().CreateInInventory("Battery9V");
				itemEnt = player.GetInventory().CreateInInventory("PistolSuppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(6);
			}
			if (( rand >= 0.4) && (rand < 0.5 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("CZ61");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(6);
			}
			if (( rand >= 0.5) && (rand < 0.6 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("Winchester70");
				itemEnt = player.GetInventory().CreateInInventory("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
			}
			if (( rand >= 0.6) && (rand < 0.7 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("Mosin9130");
				itemEnt = player.GetInventory().CreateInInventory("Mosin_Compensator");
				itemEnt = player.GetInventory().CreateInInventory("PUScopeOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
			}
			if (( rand >= 0.7) && (rand < 0.8 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("Colt1911");
				itemEnt = player.GetInventory().CreateInInventory("PistolSuppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(9);
			}
			if (( rand >= 0.8) && (rand < 0.9 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("Izh18");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
			}
			if (( rand >= 0.9) && (rand < 1.0 ))
			{
				itemEnt = player.GetInventory().CreateInInventory("CZ527");
				itemEnt = player.GetInventory().CreateInInventory("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				if ( Class.CastTo(itemBs, itemEnt ) )
					itemBs.SetQuantity(9);
			}
		//___________ My Sets END ____________
	}
}

Mission CreateCustomMission(string path)
{
	return new CustomMission();
}

но как по мне, проще было бы целочисленное число генерировать, и из него исходить по условию или блоку switch-case, так хоть ограничений бы не было в размете от 0.0 до 1.0

Благодарю, я сначала хотел так написать, но побоялся так прописывать, думал будут сразу 2 и больше условий соблюдаться, отсюда пойдут ошибки)

Share this post


Link to post
Share on other sites
  • 0

@123new  Отредактировал файл, и все бы ничего, но одежда, которую я прописал, сначала спавнилась не вся, а теперь перестала спавниться вовсе, может вам известно, как это можно починить(
 

void main()
{
	//INIT WEATHER BEFORE ECONOMY INIT------------------------
	Weather weather = g_Game.GetWeather();

	weather.MissionWeather(false);    // false = use weather controller from Weather.c

	weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
	weather.GetRain().Set( 0, 0, 1);
	weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);

	//INIT ECONOMY--------------------------------------
	Hive ce = CreateHive();
	if ( ce )
		ce.InitOffline();

	//DATE RESET AFTER ECONOMY INIT-------------------------
	int year, month, day, hour, minute;
	int reset_month = 9, reset_day = 20;
	GetGame().GetWorld().GetDate(year, month, day, hour, minute);

	if ((month == reset_month) && (day < reset_day))
	{
		GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
	}
	else
	{
		if ((month == reset_month + 1) && (day > reset_day))
		{
			GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
		}
		else
		{
			if ((month < reset_month) || (month > reset_month + 1))
			{
				GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
			}
		}
	}
}

class CustomMission: MissionServer
{
	void SetRandomHealth(EntityAI itemEnt)
	{
		if ( itemEnt )
		{
			float rndHlt = Math.RandomFloat( 1.0, 1.0 )
			itemEnt.SetHealth01( "", "", rndHlt );
		}
	}

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

		GetGame().SelectPlayer( identity, m_player );

		return m_player;
	}

	override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		
		player.RemoveAllItems();
		
		EntityAI itemClothing;
		EntityAI itemEnt;
		ItemBase itemBs;
		
		itemClothing = player.FindAttachmentBySlotName("Body");
		if ( itemClothing )
		{
			itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage");
			itemEnt = itemClothing.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Canteen");
			itemEnt = itemClothing.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
			itemEnt = itemClothing.GetInventory().CreateInInventory("M67Grenade");
			itemEnt = itemClothing.GetInventory().CreateInInventory("M67Grenade");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Morphine");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Epinephrine");

			SetRandomHealth(itemEnt);

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

			
		}			
			
		//___________ My Sets START ____________
		float rand = Math.RandomFloatInclusive(0.0, 1.0);
			if ( rand < 0.1 )
			{
				EntityAI FAL = player.GetHumanInventory().CreateInHands("FAL")
				FAL.GetInventory().CreateAttachment("Fal_OeBttstck");
				FAL.GetInventory().CreateAttachment("ACOGOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("CombatBoots_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("USMCPants_Woodland");
				itemEnt = itemClothing.GetInventory().CreateInInventory("USMCJacket_Woodland");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PilotkaCap");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.1) && (rand < 0.2 ))
			{

				EntityAI blaze = player.GetHumanInventory().CreateInHands("B95");
				blaze.GetInventory().CreateAttachment("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");				
				itemEnt = itemClothing.GetInventory().CreateInInventory("WorkingBoots_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("CargoPants_Beige");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Shirt_GreenCheck");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BeanieHat_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}	
			if (( rand >= 0.2) && (rand < 0.3 ))
			{
				EntityAI AK = player.GetHumanInventory().CreateInHands("AK74");
				AK.GetInventory().CreateAttachment("AK_WoodBttstck");
				AK.GetInventory().CreateAttachment("AK74_Hndgrd");
				AK.GetInventory().CreateAttachment("AK_Suppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("CombatBoots_Beige");
				itemEnt = itemClothing.GetInventory().CreateInInventory("USMCPants_Desert");
				itemEnt = itemClothing.GetInventory().CreateInInventory("USMCJacket_Desert");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PlateCarrierVest");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BallisticHelmet_Green");
			}
			if (( rand >= 0.3) && (rand < 0.4 ))
			{
				EntityAI MP5 = player.GetHumanInventory().CreateInHands("MP5K");
				MP5.GetInventory().CreateAttachment("MP5_PlasticHndgrd");
				MP5.GetInventory().CreateAttachment("MP5k_StockBttstck");
				MP5.GetInventory().CreateAttachment("ReflexOptic");
				MP5.GetInventory().CreateAttachment("PistolSuppressor");
				itemEnt = player.GetInventory().CreateInInventory("Battery9V");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HikingBootsLow_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PolicePantsOrel");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceJacketOrel");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PressVest_Blue");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BallisticHelmet_UN");
			}
			if (( rand >= 0.4) && (rand < 0.5 ))
			{
				EntityAI CZ = player.GetHumanInventory().CreateInHands("CZ61");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HikingBootsLow_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PolicePants");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceJacket");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceVest");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceCap");
			}
			if (( rand >= 0.5) && (rand < 0.6 ))
			{
				EntityAI Winchester = player.GetHumanInventory().CreateInHands("Winchester70");
				Winchester.GetInventory().CreateAttachment("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = itemClothing.GetInventory().CreateInInventory("WorkingBoots_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("CanvasPantsMidi_Grey");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Shirt_Joe");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BoonieHat_DPM");
			}
			if (( rand >= 0.6) && (rand < 0.7 ))
			{
				EntityAI Mosin = player.GetHumanInventory().CreateInHands("Mosin9130");
				Mosin.GetInventory().CreateAttachment("Mosin_Compensator");
				Mosin.GetInventory().CreateAttachment("PUScopeOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = itemClothing.GetInventory().CreateInInventory("WorkingBoots_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("CanvasPantsMidi_Grey");
				itemEnt = itemClothing.GetInventory().CreateInInventory("ChernarusSportShirt");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BoonieHat_Dubok");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.7) && (rand < 0.8 ))
			{
				EntityAI Colt = player.GetHumanInventory().CreateInHands("Colt1911");
				Colt.GetInventory().CreateAttachment("PistolSuppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Green");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Green");
				itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Green");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.8) && (rand < 0.85 ))
			{
				EntityAI Izh = player.GetHumanInventory().CreateInHands("Izh18");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Red");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Red");
				itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.85) && (rand < 0.9 ))
			{
				EntityAI revolver = player.GetHumanInventory().CreateInHands("Magnum");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Gray");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Gray");
				itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Red");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.9) && (rand < 0.95 ))
			{
				EntityAI CR = player.GetHumanInventory().CreateInHands("CZ527");
				CR.GetInventory().CreateAttachment("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JungleBoots_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HunterPants_Autumn");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HuntingJacket_Autumn");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BeanieHat_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.95) && (rand < 1.0 ))
			{
				EntityAI pistolet = player.GetHumanInventory().CreateInHands("Deagle_Gold");
				pistolet.GetInventory().CreateAttachment("PistolOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Blue");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Blue");
				itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Blue");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
		//___________ My Sets END ____________
		itemClothing = player.FindAttachmentBySlotName( "Legs" );
		if ( itemClothing )
			SetRandomHealth( itemClothing );
		
		itemClothing = player.FindAttachmentBySlotName( "Feet" );
		if ( itemClothing )
			SetRandomHealth( itemClothing );
	}
}

Mission CreateCustomMission(string path)
{
	return new CustomMission();
}

Вот на всякий прикрепляю файл

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Share this post


Link to post
Share on other sites
  • 0
3 часа назад, iSuss сказал:

@123new  Отредактировал файл, и все бы ничего, но одежда, которую я прописал, сначала спавнилась не вся, а теперь перестала спавниться вовсе, может вам известно, как это можно починить(
 

void main() { //INIT WEATHER BEFORE ECONOMY INIT------------------------ Weather weather = g_Game.GetWeather(); weather.MissionWeather(false); // false = use weather controller from Weather.c weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0); weather.GetRain().Set( 0, 0, 1); weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0); //INIT ECONOMY-------------------------------------- Hive ce = CreateHive(); if ( ce ) ce.InitOffline(); //DATE RESET AFTER ECONOMY INIT------------------------- int year, month, day, hour, minute; int reset_month = 9, reset_day = 20; GetGame().GetWorld().GetDate(year, month, day, hour, minute); if ((month == reset_month) && (day < reset_day)) { GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute); } else { if ((month == reset_month + 1) && (day > reset_day)) { GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute); } else { if ((month < reset_month) || (month > reset_month + 1)) { GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute); } } } } class CustomMission: MissionServer { void SetRandomHealth(EntityAI itemEnt) { if ( itemEnt ) { float rndHlt = Math.RandomFloat( 1.0, 1.0 ) itemEnt.SetHealth01( "", "", rndHlt ); } } override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName) { Entity playerEnt; playerEnt = GetGame().CreatePlayer( identity, characterName, pos, 0, "NONE" ); Class.CastTo( m_player, playerEnt ); GetGame().SelectPlayer( identity, m_player ); return m_player; } override void StartingEquipSetup(PlayerBase player, bool clothesChosen) { player.RemoveAllItems(); EntityAI itemClothing; EntityAI itemEnt; ItemBase itemBs; itemClothing = player.FindAttachmentBySlotName("Body"); if ( itemClothing ) { itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage"); itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage"); itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage"); itemEnt = itemClothing.GetInventory().CreateInInventory("TacticalBaconCan_Opened"); itemEnt = itemClothing.GetInventory().CreateInInventory("Canteen"); itemEnt = itemClothing.GetInventory().CreateInInventory("M18SmokeGrenade_Purple"); itemEnt = itemClothing.GetInventory().CreateInInventory("M67Grenade"); itemEnt = itemClothing.GetInventory().CreateInInventory("M67Grenade"); itemEnt = itemClothing.GetInventory().CreateInInventory("Morphine"); itemEnt = itemClothing.GetInventory().CreateInInventory("Epinephrine"); SetRandomHealth(itemEnt); string chemlightArray[] = { "Chemlight_White", "Chemlight_Yellow", "Chemlight_Green", "Chemlight_Red" }; int rndIndex = Math.RandomInt(0, 4); itemEnt = itemClothing.GetInventory().CreateInInventory(chemlightArray[rndIndex]); SetRandomHealth(itemEnt); } //___________ My Sets START ____________ float rand = Math.RandomFloatInclusive(0.0, 1.0); if ( rand < 0.1 ) { EntityAI FAL = player.GetHumanInventory().CreateInHands("FAL") FAL.GetInventory().CreateAttachment("Fal_OeBttstck"); FAL.GetInventory().CreateAttachment("ACOGOptic"); itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd"); itemEnt = itemClothing.GetInventory().CreateInInventory("CombatBoots_Black"); itemEnt = itemClothing.GetInventory().CreateInInventory("USMCPants_Woodland"); itemEnt = itemClothing.GetInventory().CreateInInventory("USMCJacket_Woodland"); itemEnt = itemClothing.GetInventory().CreateInInventory("PilotkaCap"); itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black"); } if (( rand >= 0.1) && (rand < 0.2 )) { EntityAI blaze = player.GetHumanInventory().CreateInHands("B95"); blaze.GetInventory().CreateAttachment("HuntingOptic"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = itemClothing.GetInventory().CreateInInventory("WorkingBoots_Brown"); itemEnt = itemClothing.GetInventory().CreateInInventory("CargoPants_Beige"); itemEnt = itemClothing.GetInventory().CreateInInventory("Shirt_GreenCheck"); itemEnt = itemClothing.GetInventory().CreateInInventory("BeanieHat_Brown"); itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black"); } if (( rand >= 0.2) && (rand < 0.3 )) { EntityAI AK = player.GetHumanInventory().CreateInHands("AK74"); AK.GetInventory().CreateAttachment("AK_WoodBttstck"); AK.GetInventory().CreateAttachment("AK74_Hndgrd"); AK.GetInventory().CreateAttachment("AK_Suppressor"); itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd"); itemEnt = itemClothing.GetInventory().CreateInInventory("CombatBoots_Beige"); itemEnt = itemClothing.GetInventory().CreateInInventory("USMCPants_Desert"); itemEnt = itemClothing.GetInventory().CreateInInventory("USMCJacket_Desert"); itemEnt = itemClothing.GetInventory().CreateInInventory("PlateCarrierVest"); itemEnt = itemClothing.GetInventory().CreateInInventory("BallisticHelmet_Green"); } if (( rand >= 0.3) && (rand < 0.4 )) { EntityAI MP5 = player.GetHumanInventory().CreateInHands("MP5K"); MP5.GetInventory().CreateAttachment("MP5_PlasticHndgrd"); MP5.GetInventory().CreateAttachment("MP5k_StockBttstck"); MP5.GetInventory().CreateAttachment("ReflexOptic"); MP5.GetInventory().CreateAttachment("PistolSuppressor"); itemEnt = player.GetInventory().CreateInInventory("Battery9V"); itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd"); itemEnt = itemClothing.GetInventory().CreateInInventory("HikingBootsLow_Black"); itemEnt = itemClothing.GetInventory().CreateInInventory("PolicePantsOrel"); itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceJacketOrel"); itemEnt = itemClothing.GetInventory().CreateInInventory("PressVest_Blue"); itemEnt = itemClothing.GetInventory().CreateInInventory("BallisticHelmet_UN"); } if (( rand >= 0.4) && (rand < 0.5 )) { EntityAI CZ = player.GetHumanInventory().CreateInHands("CZ61"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd"); itemEnt = itemClothing.GetInventory().CreateInInventory("HikingBootsLow_Black"); itemEnt = itemClothing.GetInventory().CreateInInventory("PolicePants"); itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceJacket"); itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceVest"); itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceCap"); } if (( rand >= 0.5) && (rand < 0.6 )) { EntityAI Winchester = player.GetHumanInventory().CreateInHands("Winchester70"); Winchester.GetInventory().CreateAttachment("HuntingOptic"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win"); itemEnt = itemClothing.GetInventory().CreateInInventory("WorkingBoots_Brown"); itemEnt = itemClothing.GetInventory().CreateInInventory("CanvasPantsMidi_Grey"); itemEnt = itemClothing.GetInventory().CreateInInventory("Shirt_Joe"); itemEnt = itemClothing.GetInventory().CreateInInventory("BoonieHat_DPM"); } if (( rand >= 0.6) && (rand < 0.7 )) { EntityAI Mosin = player.GetHumanInventory().CreateInHands("Mosin9130"); Mosin.GetInventory().CreateAttachment("Mosin_Compensator"); Mosin.GetInventory().CreateAttachment("PUScopeOptic"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54"); itemEnt = itemClothing.GetInventory().CreateInInventory("WorkingBoots_Brown"); itemEnt = itemClothing.GetInventory().CreateInInventory("CanvasPantsMidi_Grey"); itemEnt = itemClothing.GetInventory().CreateInInventory("ChernarusSportShirt"); itemEnt = itemClothing.GetInventory().CreateInInventory("BoonieHat_Dubok"); itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black"); } if (( rand >= 0.7) && (rand < 0.8 )) { EntityAI Colt = player.GetHumanInventory().CreateInHands("Colt1911"); Colt.GetInventory().CreateAttachment("PistolSuppressor"); itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd"); itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black"); itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Green"); itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Green"); itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Green"); itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black"); } if (( rand >= 0.8) && (rand < 0.85 )) { EntityAI Izh = player.GetHumanInventory().CreateInHands("Izh18"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39"); itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39"); itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black"); itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Red"); itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Red"); itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Brown"); itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black"); } if (( rand >= 0.85) && (rand < 0.9 )) { EntityAI revolver = player.GetHumanInventory().CreateInHands("Magnum"); itemEnt = player.GetInventory().CreateInInventory("Ammo_357"); itemEnt = player.GetInventory().CreateInInventory("Ammo_357"); itemEnt = player.GetInventory().CreateInInventory("Ammo_357"); itemEnt = player.GetInventory().CreateInInventory("Ammo_357"); itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black"); itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Gray"); itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Gray"); itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Red"); itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black"); } if (( rand >= 0.9) && (rand < 0.95 )) { EntityAI CR = player.GetHumanInventory().CreateInHands("CZ527"); CR.GetInventory().CreateAttachment("HuntingOptic"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd"); itemEnt = itemClothing.GetInventory().CreateInInventory("JungleBoots_Black"); itemEnt = itemClothing.GetInventory().CreateInInventory("HunterPants_Autumn"); itemEnt = itemClothing.GetInventory().CreateInInventory("HuntingJacket_Autumn"); itemEnt = itemClothing.GetInventory().CreateInInventory("BeanieHat_Brown"); itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black"); } if (( rand >= 0.95) && (rand < 1.0 )) { EntityAI pistolet = player.GetHumanInventory().CreateInHands("Deagle_Gold"); pistolet.GetInventory().CreateAttachment("PistolOptic"); itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd"); itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd"); itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black"); itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Blue"); itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Blue"); itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Blue"); itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black"); } //___________ My Sets END ____________ itemClothing = player.FindAttachmentBySlotName( "Legs" ); if ( itemClothing ) SetRandomHealth( itemClothing ); itemClothing = player.FindAttachmentBySlotName( "Feet" ); if ( itemClothing ) SetRandomHealth( itemClothing ); } } Mission CreateCustomMission(string path) { return new CustomMission(); }


void main()
{
	//INIT WEATHER BEFORE ECONOMY INIT------------------------
	Weather weather = g_Game.GetWeather();

	weather.MissionWeather(false);    // false = use weather controller from Weather.c

	weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
	weather.GetRain().Set( 0, 0, 1);
	weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);

	//INIT ECONOMY--------------------------------------
	Hive ce = CreateHive();
	if ( ce )
		ce.InitOffline();

	//DATE RESET AFTER ECONOMY INIT-------------------------
	int year, month, day, hour, minute;
	int reset_month = 9, reset_day = 20;
	GetGame().GetWorld().GetDate(year, month, day, hour, minute);

	if ((month == reset_month) && (day < reset_day))
	{
		GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
	}
	else
	{
		if ((month == reset_month + 1) && (day > reset_day))
		{
			GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
		}
		else
		{
			if ((month < reset_month) || (month > reset_month + 1))
			{
				GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
			}
		}
	}
}

class CustomMission: MissionServer
{
	void SetRandomHealth(EntityAI itemEnt)
	{
		if ( itemEnt )
		{
			float rndHlt = Math.RandomFloat( 1.0, 1.0 )
			itemEnt.SetHealth01( "", "", rndHlt );
		}
	}

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

		GetGame().SelectPlayer( identity, m_player );

		return m_player;
	}

	override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		
		player.RemoveAllItems();
		
		EntityAI itemClothing;
		EntityAI itemEnt;
		ItemBase itemBs;
		
		itemClothing = player.FindAttachmentBySlotName("Body");
		if ( itemClothing )
		{
			itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage");
			itemEnt = itemClothing.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Canteen");
			itemEnt = itemClothing.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
			itemEnt = itemClothing.GetInventory().CreateInInventory("M67Grenade");
			itemEnt = itemClothing.GetInventory().CreateInInventory("M67Grenade");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Morphine");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Epinephrine");

			SetRandomHealth(itemEnt);

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

			
		}			
			
		//___________ My Sets START ____________
		float rand = Math.RandomFloatInclusive(0.0, 1.0);
			if ( rand < 0.1 )
			{
				EntityAI FAL = player.GetHumanInventory().CreateInHands("FAL")
				FAL.GetInventory().CreateAttachment("Fal_OeBttstck");
				FAL.GetInventory().CreateAttachment("ACOGOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("CombatBoots_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("USMCPants_Woodland");
				itemEnt = itemClothing.GetInventory().CreateInInventory("USMCJacket_Woodland");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PilotkaCap");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.1) && (rand < 0.2 ))
			{

				EntityAI blaze = player.GetHumanInventory().CreateInHands("B95");
				blaze.GetInventory().CreateAttachment("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");				
				itemEnt = itemClothing.GetInventory().CreateInInventory("WorkingBoots_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("CargoPants_Beige");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Shirt_GreenCheck");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BeanieHat_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}	
			if (( rand >= 0.2) && (rand < 0.3 ))
			{
				EntityAI AK = player.GetHumanInventory().CreateInHands("AK74");
				AK.GetInventory().CreateAttachment("AK_WoodBttstck");
				AK.GetInventory().CreateAttachment("AK74_Hndgrd");
				AK.GetInventory().CreateAttachment("AK_Suppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("CombatBoots_Beige");
				itemEnt = itemClothing.GetInventory().CreateInInventory("USMCPants_Desert");
				itemEnt = itemClothing.GetInventory().CreateInInventory("USMCJacket_Desert");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PlateCarrierVest");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BallisticHelmet_Green");
			}
			if (( rand >= 0.3) && (rand < 0.4 ))
			{
				EntityAI MP5 = player.GetHumanInventory().CreateInHands("MP5K");
				MP5.GetInventory().CreateAttachment("MP5_PlasticHndgrd");
				MP5.GetInventory().CreateAttachment("MP5k_StockBttstck");
				MP5.GetInventory().CreateAttachment("ReflexOptic");
				MP5.GetInventory().CreateAttachment("PistolSuppressor");
				itemEnt = player.GetInventory().CreateInInventory("Battery9V");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HikingBootsLow_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PolicePantsOrel");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceJacketOrel");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PressVest_Blue");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BallisticHelmet_UN");
			}
			if (( rand >= 0.4) && (rand < 0.5 ))
			{
				EntityAI CZ = player.GetHumanInventory().CreateInHands("CZ61");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HikingBootsLow_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PolicePants");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceJacket");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceVest");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PoliceCap");
			}
			if (( rand >= 0.5) && (rand < 0.6 ))
			{
				EntityAI Winchester = player.GetHumanInventory().CreateInHands("Winchester70");
				Winchester.GetInventory().CreateAttachment("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = itemClothing.GetInventory().CreateInInventory("WorkingBoots_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("CanvasPantsMidi_Grey");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Shirt_Joe");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BoonieHat_DPM");
			}
			if (( rand >= 0.6) && (rand < 0.7 ))
			{
				EntityAI Mosin = player.GetHumanInventory().CreateInHands("Mosin9130");
				Mosin.GetInventory().CreateAttachment("Mosin_Compensator");
				Mosin.GetInventory().CreateAttachment("PUScopeOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = itemClothing.GetInventory().CreateInInventory("WorkingBoots_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("CanvasPantsMidi_Grey");
				itemEnt = itemClothing.GetInventory().CreateInInventory("ChernarusSportShirt");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BoonieHat_Dubok");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.7) && (rand < 0.8 ))
			{
				EntityAI Colt = player.GetHumanInventory().CreateInHands("Colt1911");
				Colt.GetInventory().CreateAttachment("PistolSuppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Green");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Green");
				itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Green");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.8) && (rand < 0.85 ))
			{
				EntityAI Izh = player.GetHumanInventory().CreateInHands("Izh18");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Red");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Red");
				itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.85) && (rand < 0.9 ))
			{
				EntityAI revolver = player.GetHumanInventory().CreateInHands("Magnum");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Gray");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Gray");
				itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Red");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.9) && (rand < 0.95 ))
			{
				EntityAI CR = player.GetHumanInventory().CreateInHands("CZ527");
				CR.GetInventory().CreateAttachment("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JungleBoots_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HunterPants_Autumn");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HuntingJacket_Autumn");
				itemEnt = itemClothing.GetInventory().CreateInInventory("BeanieHat_Brown");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
			if (( rand >= 0.95) && (rand < 1.0 ))
			{
				EntityAI pistolet = player.GetHumanInventory().CreateInHands("Deagle_Gold");
				pistolet.GetInventory().CreateAttachment("PistolOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitPants_Blue");
				itemEnt = itemClothing.GetInventory().CreateInInventory("JumpsuitJacket_Blue");
				itemEnt = itemClothing.GetInventory().CreateInInventory("RadarCap_Blue");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}
		//___________ My Sets END ____________
		itemClothing = player.FindAttachmentBySlotName( "Legs" );
		if ( itemClothing )
			SetRandomHealth( itemClothing );
		
		itemClothing = player.FindAttachmentBySlotName( "Feet" );
		if ( itemClothing )
			SetRandomHealth( itemClothing );
	}
}

Mission CreateCustomMission(string path)
{
	return new CustomMission();
}

Вот на всякий прикрепляю файл

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

что именно отсутствует то? подробнее

Share this post


Link to post
Share on other sites
  • 0

@123new Ну, скажем, спавнятся штаны на персонаже, а вот куртка в штанах, а иногда наоборот, а помимо них ничего из одежды, хоть и должно

Share this post


Link to post
Share on other sites
  • 0
12 минут назад, iSuss сказал:

@123new Ну, скажем, спавнятся штаны на персонаже, а вот куртка в штанах, а иногда наоборот, а помимо них ничего из одежды, хоть и должно

потому как к моменту выполнения функции StartingEquipSetup на персонаже стартовые шмотки уже имеются, те что игрок выбирает сам в гл меню игры в настройках стартового персонажа. Комманда player.RemoveAllItems(); должно решать этот вопрос перед спавном нового лута.

Теперь пробегаемся по вашему иниту. Нюанс 1:

player.RemoveAllItems();

вы удаляете лут, но далее

itemClothing = player.FindAttachmentBySlotName("Body");
		if ( itemClothing )
		{
			itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Bandage");
			itemEnt = itemClothing.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Canteen");
			itemEnt = itemClothing.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
			itemEnt = itemClothing.GetInventory().CreateInInventory("M67Grenade");
			itemEnt = itemClothing.GetInventory().CreateInInventory("M67Grenade");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Morphine");
			itemEnt = itemClothing.GetInventory().CreateInInventory("Epinephrine");

			SetRandomHealth(itemEnt);

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

			
		}		

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

Нюанс 2:

в коде, например, 1 сета:

if ( rand < 0.1 )
			{
				EntityAI FAL = player.GetHumanInventory().CreateInHands("FAL")
				FAL.GetInventory().CreateAttachment("Fal_OeBttstck");
				FAL.GetInventory().CreateAttachment("ACOGOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = itemClothing.GetInventory().CreateInInventory("CombatBoots_Black");
				itemEnt = itemClothing.GetInventory().CreateInInventory("USMCPants_Woodland");
				itemEnt = itemClothing.GetInventory().CreateInInventory("USMCJacket_Woodland");
				itemEnt = itemClothing.GetInventory().CreateInInventory("PilotkaCap");
				itemEnt = itemClothing.GetInventory().CreateInInventory("HighCapacityVest_Black");
			}

вы пытаетесь спавнить CombatBoots_Black, USMCPants_Woodland, USMCJacket_Woodland, PilotkaCap, HighCapacityVest_Black на что? Ну, явно не на игрока, учитывая itemClothing.GetInventory().CreateInInventory. А теперь поглядите, что такое в переменной itemClothing ? Правильно, то что обозначено в 1 нюансе. Но так как на игроке на тот момент ничего не было, то откуда же этой переменной заполниться данными на момент исполнения последнего кода? Разумеется, она будет равна NULL, и на игроке эти вещи не соспавнятся, т.к. самой шмотки нету, сервер не знает на чем спавнить это.  Причем, эти строчки не просто не будут работать, но еще и ошибки в крашлоге будут писать, .к. с точки зрения логики кода игры это критическая ошибка.

 

Учитывая выше написанное, не удивительно, что не все спавнится у вас.

Способ исправления сознательно не говорю, чтобы вы научились думать сами. Подсказки дал выше.

Edited by 123new (see edit history)

Share this post


Link to post
Share on other sites
  • 0

@123new Поправил файл, но возникла новая проблема: теперь перестало выдаваться оружие

void main()
{
	//INIT WEATHER BEFORE ECONOMY INIT------------------------
	Weather weather = g_Game.GetWeather();

	weather.MissionWeather(false);    // false = use weather controller from Weather.c

	weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
	weather.GetRain().Set( 0, 0, 1);
	weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);

	//INIT ECONOMY--------------------------------------
	Hive ce = CreateHive();
	if ( ce )
		ce.InitOffline();

	//DATE RESET AFTER ECONOMY INIT-------------------------
	int year, month, day, hour, minute;
	int reset_month = 9, reset_day = 20;
	GetGame().GetWorld().GetDate(year, month, day, hour, minute);

	if ((month == reset_month) && (day < reset_day))
	{
		GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
	}
	else
	{
		if ((month == reset_month + 1) && (day > reset_day))
		{
			GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
		}
		else
		{
			if ((month < reset_month) || (month > reset_month + 1))
			{
				GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
			}
		}
	}
}

class CustomMission: MissionServer
{
	void SetRandomHealth(EntityAI itemEnt)
	{
		if ( itemEnt )
		{
			float rndHlt = Math.RandomFloat( 1.0, 1.0 )
			itemEnt.SetHealth01( "", "", rndHlt );
		}
	}

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

		GetGame().SelectPlayer( identity, m_player );

		return m_player;
	}

	override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		
		player.RemoveAllItems();
		
		EntityAI itemEnt;
		ItemBase itemBs;
		
			
		//___________ My Sets START ____________
		float rand = Math.RandomFloatInclusive(0.0, 1.0);
			if ( rand < 0.1 )
			{
				EntityAI FAL = player.GetHumanInventory().CreateInHands("FAL")
				FAL.GetInventory().CreateAttachment("Fal_OeBttstck");
				FAL.GetInventory().CreateAttachment("ACOGOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_FAL_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("CombatBoots_Black");
				itemEnt = player.GetInventory().CreateInInventory("USMCPants_Woodland");
				itemEnt = player.GetInventory().CreateInInventory("USMCJacket_Woodland");
				itemEnt = player.GetInventory().CreateInInventory("PilotkaCap");
				itemEnt = player.GetInventory().CreateInInventory("HighCapacityVest_Black");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}
			if (( rand >= 0.1) && (rand < 0.2 ))
			{

				EntityAI blaze = player.GetHumanInventory().CreateInHands("B95");
				blaze.GetInventory().CreateAttachment("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");				
				itemEnt = player.GetInventory().CreateInInventory("WorkingBoots_Brown");
				itemEnt = player.GetInventory().CreateInInventory("CargoPants_Beige");
				itemEnt = player.GetInventory().CreateInInventory("Shirt_GreenCheck");
				itemEnt = player.GetInventory().CreateInInventory("BeanieHat_Brown");
				itemEnt = player.GetInventory().CreateInInventory("HighCapacityVest_Black");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}	
			if (( rand >= 0.2) && (rand < 0.3 ))
			{
				EntityAI AK = player.GetHumanInventory().CreateInHands("AK74");
				AK.GetInventory().CreateAttachment("AK_WoodBttstck");
				AK.GetInventory().CreateAttachment("AK74_Hndgrd");
				AK.GetInventory().CreateAttachment("AK_Suppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("CombatBoots_Beige");
				itemEnt = player.GetInventory().CreateInInventory("USMCPants_Desert");
				itemEnt = player.GetInventory().CreateInInventory("USMCJacket_Desert");
				itemEnt = player.GetInventory().CreateInInventory("PlateCarrierVest");
				itemEnt = player.GetInventory().CreateInInventory("BallisticHelmet_Green");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}
			if (( rand >= 0.3) && (rand < 0.4 ))
			{
				EntityAI MP5 = player.GetHumanInventory().CreateInHands("MP5K");
				MP5.GetInventory().CreateAttachment("MP5_PlasticHndgrd");
				MP5.GetInventory().CreateAttachment("MP5k_StockBttstck");
				MP5.GetInventory().CreateAttachment("ReflexOptic");
				MP5.GetInventory().CreateAttachment("PistolSuppressor");
				itemEnt = player.GetInventory().CreateInInventory("Battery9V");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");
				itemEnt = player.GetInventory().CreateInInventory("HikingBootsLow_Black");
				itemEnt = player.GetInventory().CreateInInventory("PolicePantsOrel");
				itemEnt = player.GetInventory().CreateInInventory("PoliceJacketOrel");
				itemEnt = player.GetInventory().CreateInInventory("PressVest_Blue");
				itemEnt = player.GetInventory().CreateInInventory("BallisticHelmet_UN");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}
			if (( rand >= 0.4) && (rand < 0.5 ))
			{
				EntityAI CZ = player.GetHumanInventory().CreateInHands("CZ61");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ61_20Rnd");
				itemEnt = player.GetInventory().CreateInInventory("HikingBootsLow_Black");
				itemEnt = player.GetInventory().CreateInInventory("PolicePants");
				itemEnt = player.GetInventory().CreateInInventory("PoliceJacket");
				itemEnt = player.GetInventory().CreateInInventory("PoliceVest");
				itemEnt = player.GetInventory().CreateInInventory("PoliceCap");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}
			if (( rand >= 0.5) && (rand < 0.6 ))
			{
				EntityAI Winchester = player.GetHumanInventory().CreateInHands("Winchester70");
				Winchester.GetInventory().CreateAttachment("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_308Win");
				itemEnt = player.GetInventory().CreateInInventory("WorkingBoots_Brown");
				itemEnt = player.GetInventory().CreateInInventory("CanvasPantsMidi_Grey");
				itemEnt = player.GetInventory().CreateInInventory("Shirt_Joe");
				itemEnt = player.GetInventory().CreateInInventory("BoonieHat_DPM");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}
			if (( rand >= 0.6) && (rand < 0.7 ))
			{
				EntityAI Mosin = player.GetHumanInventory().CreateInHands("Mosin9130");
				Mosin.GetInventory().CreateAttachment("Mosin_Compensator");
				Mosin.GetInventory().CreateAttachment("PUScopeOptic");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x54");
				itemEnt = player.GetInventory().CreateInInventory("WorkingBoots_Brown");
				itemEnt = player.GetInventory().CreateInInventory("CanvasPantsMidi_Grey");
				itemEnt = player.GetInventory().CreateInInventory("ChernarusSportShirt");
				itemEnt = player.GetInventory().CreateInInventory("BoonieHat_Dubok");
				itemEnt = player.GetInventory().CreateInInventory("HighCapacityVest_Black");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}
			if (( rand >= 0.7) && (rand < 0.8 ))
			{
				EntityAI Colt = player.GetHumanInventory().CreateInHands("Colt1911");
				Colt.GetInventory().CreateAttachment("PistolSuppressor");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
				itemEnt = player.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = player.GetInventory().CreateInInventory("JumpsuitPants_Green");
				itemEnt = player.GetInventory().CreateInInventory("JumpsuitJacket_Green");
				itemEnt = player.GetInventory().CreateInInventory("RadarCap_Green");
				itemEnt = player.GetInventory().CreateInInventory("HighCapacityVest_Black");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}
			if (( rand >= 0.8) && (rand < 0.85 ))
			{
				EntityAI Izh = player.GetHumanInventory().CreateInHands("Izh18");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
				itemEnt = player.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = player.GetInventory().CreateInInventory("JumpsuitPants_Red");
				itemEnt = player.GetInventory().CreateInInventory("JumpsuitJacket_Red");
				itemEnt = player.GetInventory().CreateInInventory("RadarCap_Brown");
				itemEnt = player.GetInventory().CreateInInventory("HighCapacityVest_Black");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}
			if (( rand >= 0.85) && (rand < 0.9 ))
			{
				EntityAI revolver = player.GetHumanInventory().CreateInHands("Magnum");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = player.GetInventory().CreateInInventory("Ammo_357");
				itemEnt = player.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = player.GetInventory().CreateInInventory("JumpsuitPants_Gray");
				itemEnt = player.GetInventory().CreateInInventory("JumpsuitJacket_Gray");
				itemEnt = player.GetInventory().CreateInInventory("RadarCap_Red");
				itemEnt = player.GetInventory().CreateInInventory("HighCapacityVest_Black");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}
			if (( rand >= 0.9) && (rand < 0.95 ))
			{
				EntityAI CR = player.GetHumanInventory().CreateInHands("CZ527");
				CR.GetInventory().CreateAttachment("HuntingOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_CZ527_5rnd");
				itemEnt = player.GetInventory().CreateInInventory("JungleBoots_Black");
				itemEnt = player.GetInventory().CreateInInventory("HunterPants_Autumn");
				itemEnt = player.GetInventory().CreateInInventory("HuntingJacket_Autumn");
				itemEnt = player.GetInventory().CreateInInventory("BeanieHat_Brown");
				itemEnt = player.GetInventory().CreateInInventory("HighCapacityVest_Black");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}
			if (( rand >= 0.95) && (rand < 1.0 ))
			{
				EntityAI pistolet = player.GetHumanInventory().CreateInHands("Deagle_Gold");
				pistolet.GetInventory().CreateAttachment("PistolOptic");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Mag_Deagle_9rnd");
				itemEnt = player.GetInventory().CreateInInventory("Wellies_Black");
				itemEnt = player.GetInventory().CreateInInventory("JumpsuitPants_Blue");
				itemEnt = player.GetInventory().CreateInInventory("JumpsuitJacket_Blue");
				itemEnt = player.GetInventory().CreateInInventory("RadarCap_Blue");
				itemEnt = player.GetInventory().CreateInInventory("HighCapacityVest_Black");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("Bandage");
				itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
				itemEnt = player.GetInventory().CreateInInventory("Canteen");
				itemEnt = player.GetInventory().CreateInInventory("M18SmokeGrenade_Purple");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("M67Grenade");
				itemEnt = player.GetInventory().CreateInInventory("Morphine");
				itemEnt = player.GetInventory().CreateInInventory("Epinephrine");
			}
		//___________ My Sets END ____________
	}
}

Mission CreateCustomMission(string path)
{
	return new CustomMission();
}

 

Edited by iSuss (see edit history)

Share this post


Link to post
Share on other sites
  • 0

@123new Благодаря вам +/- разобрался, огромное спасибо) Однако все еще не до конца понимаю, как выбрать шмотку, в которую будут спавниться такие вещи, как адреналин и тп, и почему не спавнится бинт)

UPD с бинтами разобрался, мой косяк: прописал не то имя

Edited by iSuss (see edit history)

Share this post


Link to post
Share on other sites
  • 0
53 минуты назад, iSuss сказал:

@123new Благодаря вам +/- разобрался, огромное спасибо) Однако все еще не до конца понимаю, как выбрать шмотку, в которую будут спавниться такие вещи, как адреналин и тп, и почему не спавнится бинт)

UPD с бинтами разобрался, мой косяк: прописал не то имя

все дело в синтаксисе. Вот смотрите, комманда player.GetInventory().CreateInInventory("что-то"); здесь указан player, т.е. объект типа PlayerBase, проще говоря персонаж игрока, уже созданный в момент начала выполнения функции. Ну или проще для нашего понимания, наш спавнящийся игрок. В данном случае вещь спавнится именно на игрока в любую свободную вещь, куда может поместиться в виде 'поумолчанию' (т.е. без поворотов, разворотов и т.п. игры в тетрис инвентаря, просто как есть).

А вот в синтаксисе itemClothing.GetInventory().CreateInInventory("что-то"); объект будет спавниться именно в инвентарь того предмета, который записан у вас в переменной itemClothing. Т.е. например мы создаем предмет какой-то и присваиваем его значение в созданную нами только что переменную:

EntityAI shtany = = player.GetInventory().CreateInInventory("JumpsuitPants_Blue");

если предмет создался, значение переменной shtany будет отличное от NULL и проверка if(shtany) вернет true (истина). А вот если он не смог создаться по какой-тор причине (например, места не было в инвентаре или слот занят или еще что-то) - будет NULL и проверка if(shtany) вернет false (ложь). Соответственно тут уже с условиями можно играться (это скриптинг буквальный).

Соответственно если далее мы спавним предмет например так:

shtany.GetInventory().CreateInInventory("Morphine");

то мы говорим предмету соспавниться именно внутри этого предмета, т.е. ранее появившихся штанов. И ту возможны следующие варианты:

1. Предмет соспавнится, если имеются слоты в нем свободные и он помещается в них (спавн поумолчанию опять же)

2. предмет не соспавнится т.к. дочерний предмет не имеет слотов, либо закрыт доступ к инвентарю (например, у бочек есть крышки)

3. предмет не соспавнится, т.к. дочерний объект просто не существует (т.е. переменная shtany имеет значение NULL)

Все это выше описанное скриптинг буквальный. Даже сама комманда player.GetInventory().CreateInInventory делится на несколько операций, среди которых player - объект, GetInventory() - функция внутри объекта player с его типом класса, где CreateInInventory также функция внутри результата функции, который вернет GetInventory(). Все это можно и нужно изучать внутри scripts.pbo игры. Подробнее вдаваться не буду

Share this post


Link to post
Share on other sites
  • 0

@123new Доброго времени суток, а можете подсказать, в каком(каких) файлах настраивается качество лута. Чтобы лут спавнился не с качеством "нетронуто", а, к примеру, от сильно "повреждено"до "поношено"?

Share this post


Link to post
Share on other sites
  • 0
45 минут назад, iSuss сказал:

@123new Доброго времени суток, а можете подсказать, в каком(каких) файлах настраивается качество лута. Чтобы лут спавнился не с качеством "нетронуто", а, к примеру, от сильно "повреждено"до "поношено"?

насколько знаю, ни в каком. Есть только в cfgspawnabletypes.xml параметр     <damage min="0.3" max="0.7" /> , но он только для "лута в луте", так сказать

Share this post


Link to post
Share on other sites
  • 0

......для всего лута который есть в файле. (как раз лут в луте этот параметр и не трогает)

 

Share this post


Link to post
Share on other sites
  • 0

Где-то в конфигах в каком-то cpp я видел такое

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.