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
supernks

Спавн лута в ящиках на вертолётах (хеликраш)

Доброго времени суток хочу сделать на своём сервере спавн лута в деревянных ящиках на хеликрашах тобишь вертах (увидел такую темку на каком то

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

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

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

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts




  • 0
20 минут назад, paranoyk сказал:

А откуда скрины спросить нельзя?

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

Share this post


Link to post
Share on other sites
  • 0

Остановить сервер, сделать полный вайп. Ввести свою категорию для ящика, прописать категорию в сетку лута хеликраша,прописать категорию для ящика, убрать у ящика тэг "создаваемый". Ящику прописываем с 100% гарантией спавна внутри лут, АКМ не используемый, чёрный к примеру прописываем в тайпс и прописываем ему аттачи с 100%. Запускаем сервер.

Share this post


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

Остановить сервер, сделать полный вайп. Ввести свою категорию для ящика, прописать категорию в сетку лута хеликраша,прописать категорию для ящика, убрать у ящика тэг "создаваемый". Ящику прописываем с 100% гарантией спавна внутри лут, АКМ не используемый, чёрный к примеру прописываем в тайпс и прописываем ему аттачи с 100%. Запускаем сервер.

могу ли я к примеру создать 5 таких ящиков чтобы какой то из них спавнился рандомно?

Share this post


Link to post
Share on other sites
  • 0
ref HeliWreck m_HeliWreck = new HeliWreck();

class HeliWreck 
{
	ref array<EntityAI> m_SpawnedZombies = new array<EntityAI>;	
	EntityAI Heli;
	EntityAI Chest
	const string boxtype = "SeaChest";
	const int spawntime = 1200;  //Время до спавна след. вертолета в сек.
	ref TVectorArray SpawnCoords = {
		"Тут координата"
	}; 
	int INT_MAX_ZOMBIES      	 = 16;     //Макс. кол-во зомби
	int INT_MIN_ZOMBIES       	 = 10;      //Мин. кол-во зомби

	
	void HeliWreck()
	{
		//s_Conf = new SpawnConfig();
		GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(this.SpawnHeli, spawntime * 1000, true);
		GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(this.clearplace, 10000, false);
	}

	void ~HeliWreck()
	{
		
	}
	
	void clearplace()
    {
        for (int i = 0; i < SpawnCoords.Count(); ++i)
        {
            array<Object> PrivateObjects = new array<Object>;    //Объекты в зонах
            array<CargoBase> PrivateCargos = new array<CargoBase>;             
            GetGame().GetObjectsAtPosition3D( SnapToGroundZ(SpawnCoords.Get(i)), 15, PrivateObjects, PrivateCargos);
            for (int j = 0; j < PrivateObjects.Count(); ++j)
            {
                EntityAI tempEnt = EntityAI.Cast(PrivateObjects.Get(j));
                if (tempEnt && (tempEnt.GetType() == boxtype))
                {
					if (PrivateObjects.Get(j) != Chest)
						GetGame().ObjectDelete(PrivateObjects.Get(j));
                }
            }
        }
    }

	void SpawnHeli()
	{
		CleanUp();
		vector pos = SnapToGroundZ(SpawnCoords.GetRandomElement());
		//Heli = GetGame().CreateObject( "land_wrecked_mi8", pos, false, true );
		Heli = GetGame().CreateObject( "Wreck_Mi8_Crashed", Vector(pos[0], pos[1]+1 , pos[2]), false, true );
		TStringArray Trophy	= Trophys.GetRandomElement();
		vector pos1 = SnapToGroundZ(Vector(pos[0] - 3, pos[1] , pos[2] + 1));
		Chest = GetGame().CreateObject(boxtype, pos1, false, true);
		Container_Base loot = Container_Base.Cast(Chest);
		//loot.Open();
		if ( Trophy.Count() > 0 )
		{
			EntityAI trophy = loot.GetInventory().CreateEntityInCargo(Trophy[0]);		
			if (trophy)
			{
				loot.GetInventory().CreateEntityInCargo(Trophy[1]);
				loot.GetInventory().CreateEntityInCargo(Trophy[1]);	
				for (private int j = 2; j < Trophy.Count(); j++)
				{
					loot.GetInventory().CreateEntityInCargo(Trophy[j]);
				}
			}
		}
		loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleLootDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleLootDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleToolsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleToolsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleFoodDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleFoodDrops.GetRandomElement());
		//loot.Close();	
		int oRandValue   = Math.RandomIntInclusive(INT_MIN_ZOMBIES,INT_MAX_ZOMBIES);		
		for (int i = 0; i < oRandValue; ++i)
		{
			int rndS1  = Math.RandomIntInclusive(-1,1);
			float rndX  = Math.RandomIntInclusive(5,10) * rndS1;
			if (rndS1 == 0)
			{
				while (rndS1 == 0)
				{
					rndS1  = Math.RandomIntInclusive(-1,1);
					rndX  = Math.RandomIntInclusive(5,10) * rndS1;
				}
			}
			else
			{
				rndS1  = Math.RandomIntInclusive(-1,1);
			}
			float rndY  = Math.RandomIntInclusive(5,10) * rndS1;
			pos1 = SnapToGroundZ(Vector(pos[0] + rndX, pos[1] , pos[2] + rndY));		
			EntityAI AIzmb = GetGame().CreateObject( ZombieClasses.GetRandomElement(), pos1, false, true );
			if (AIzmb) 
			{
				AIzmb.GetInventory().CreateInInventory("Ssh68Helmet");
				
			}
			ref ZombieBase Bszmb;
			Class.CastTo(Bszmb,AIzmb);
			if (Bszmb)
			{
				m_SpawnedZombies.Insert(AIzmb);
			}	
		}		
	}

	void CleanUp()
	{		
		if (Heli) GetGame().ObjectDelete(Heli);
		if (Chest) GetGame().ObjectDelete(Chest);
		for (int i = 0; i < m_SpawnedZombies.Count(); ++i)
		{
			EntityAI zmb = m_SpawnedZombies.Get(i);
			GetGame().ObjectDelete(zmb);
		}
		m_SpawnedZombies.Clear();
	}
	
	ref TStringArray PossibleAttachmentsDrops = {
		"","AK_RailHndgrd","M4_RISHndgrd",
		"AKS74U_Bttstck","","M4_OEBttstck","",
		"Fal_FoldingBttstck","Mag_AK101_30Rnd","Mag_AK74_30Rnd",
		"AKS74U_Bttstck","Mag_AK74_30Rnd","Mag_AKM_30Rnd",		
		"Mag_VSS_10Rnd","ACOGOptic","AK_RailHndgrd",
		"AK_FoldingBttstck","M4_RISHndgrd","AKS74U_Bttstck",
		"","","","AKS74U_Bttstck","",
		"","Mag_AK74_30Rnd","Mag_CMAG_30Rnd",
		"Mag_VSS_10Rnd","Mag_Saiga_8Rnd","","",	
		"AK_FoldingBttstck","","M4_OEBttstck","",
		"","Mag_Saiga_5Rnd","Mag_VSS_10Rnd",
		"AK_FoldingBttstck","M4_OEBttstck","",
		"","Mag_Saiga_5Rnd","",	
	};		
	
	ref TStringArray PossibleAmmosDrops = {
		"ammo_45acp", "ammo_556x45", "ammo_762x39",
		"Ammo_545x39","Ammo_12gaSlug","Ammo_545x39",
		"Ammo_12gaPellets","AmmoBox_556x45_20Rnd",
		"ammo_762x39","Ammo_12gaPellets","ammo_45acp",
		"AmmoBox_357_20Rnd","AmmoBox_545x39_20Rnd",
		"AmmoBox_9x39AP_20Rnd","Ammo_9x39","ammo_45acp",
		"","ammo_556x45", "AmmoBox_762x39_20Rnd",
		"Ammo_12gaSlug","","Ammo_545x39","Ammo_12gaSlug",
		"","Ammo_12gaPellets","AmmoBox_357_20Rnd",
		"Ammo_9x39","","","Ammo_357","Ammo_357",
	};
	
	ref TStringArray PossibleClothesDrops = {
		"NylonKnifeSheath","PlateCarrierHolster",
		"HuntingJacket_Autumn","HunterPants_Autumn",
	};
		
	ref TStringArray PossibleClothesDropsMil = {
		"","MilitaryBelt",
		"",
	};
	
	ref TStringArray PossibleToolsDrops = {
		"","","IO_Radiation_pills","",""
	};	

	ref TStringArray PossibleLootDrops = {
		"BandageDressing","BandageDressing","","","","",
	};

	ref TStringArray PossibleFoodDrops = {
		"BandageDressing","BandageDressing","","",
	};

	ref array<ref TStringArray> Trophys = {
		{"M4A1","Mag_CMAG_40Rnd","M4_OEBttstck","M4_RISHndgrd",},
		{"M4A1","Mag_CMAG_40Rnd","","M4_OEBttstck","M4_RISHndgrd",},
		{"AKM","Mag_AKM_30Rnd","AK_FoldingBttstck","AK_RailHndgrd",},
		{"AKM","Mag_AKM_30Rnd","","AK_FoldingBttstck","AK_RailHndgrd",},
		{"AK101","Mag_AK101_30Rnd","","AKS74U_Bttstck","AK_RailHndgrd_Black",},
		{"AK101","Mag_AK101_30Rnd","","AKS74U_Bttstck","AK_RailHndgrd_Black",},
		{"AK74","Mag_AK74_30Rnd","AKS74U_Bttstck","AK74_Hndgrd",},		
		{"AK74","Mag_AK74_30Rnd","","AKS74U_Bttstck","AK74_Hndgrd",},
	};	
	
	ref TStringArray ZombieClasses = {
		"Mutant_AoD_Snork1_Easy","Mutant_AoD_Snork2_Easy",
	};	

	vector SnapToGroundZ(vector pos)
    {
        float pos_x = pos[0];
        float pos_z = pos[2];
        float pos_y = GetGame().SurfaceY( pos_x, pos_z );
        vector tmp_pos = Vector( pos_x, pos_y, pos_z );
        return tmp_pos;
    }	
}

#include "$CurrentDir:mpmissions\"Тут название папки миссии"\HeliCrash.c"
Сам файл так и должен называться: "HeliCrash.c" (Хотя можешь назвать как угодно)

Edited by Melnikov (see edit history)

Share this post


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

ref HeliWreck m_HeliWreck = new HeliWreck(); class HeliWreck { ref array<EntityAI> m_SpawnedZombies = new array<EntityAI>; EntityAI Heli; EntityAI Chest const string boxtype = "SeaChest"; const int spawntime = 1200; //Время до спавна след. вертолета в сек. ref TVectorArray SpawnCoords = { "Тут координата" }; int INT_MAX_ZOMBIES = 16; //Макс. кол-во зомби int INT_MIN_ZOMBIES = 10; //Мин. кол-во зомби void HeliWreck() { //s_Conf = new SpawnConfig(); GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(this.SpawnHeli, spawntime * 1000, true); GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(this.clearplace, 10000, false); } void ~HeliWreck() { } void clearplace() { for (int i = 0; i < SpawnCoords.Count(); ++i) { array<Object> PrivateObjects = new array<Object>; //Объекты в зонах array<CargoBase> PrivateCargos = new array<CargoBase>; GetGame().GetObjectsAtPosition3D( SnapToGroundZ(SpawnCoords.Get(i)), 15, PrivateObjects, PrivateCargos); for (int j = 0; j < PrivateObjects.Count(); ++j) { EntityAI tempEnt = EntityAI.Cast(PrivateObjects.Get(j)); if (tempEnt && (tempEnt.GetType() == boxtype)) { if (PrivateObjects.Get(j) != Chest) GetGame().ObjectDelete(PrivateObjects.Get(j)); } } } } void SpawnHeli() { CleanUp(); vector pos = SnapToGroundZ(SpawnCoords.GetRandomElement()); //Heli = GetGame().CreateObject( "land_wrecked_mi8", pos, false, true ); Heli = GetGame().CreateObject( "Wreck_Mi8_Crashed", Vector(pos[0], pos[1]+1 , pos[2]), false, true ); TStringArray Trophy = Trophys.GetRandomElement(); vector pos1 = SnapToGroundZ(Vector(pos[0] - 3, pos[1] , pos[2] + 1)); Chest = GetGame().CreateObject(boxtype, pos1, false, true); Container_Base loot = Container_Base.Cast(Chest); //loot.Open(); if ( Trophy.Count() > 0 ) { EntityAI trophy = loot.GetInventory().CreateEntityInCargo(Trophy[0]); if (trophy) { loot.GetInventory().CreateEntityInCargo(Trophy[1]); loot.GetInventory().CreateEntityInCargo(Trophy[1]); for (private int j = 2; j < Trophy.Count(); j++) { loot.GetInventory().CreateEntityInCargo(Trophy[j]); } } } loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleLootDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleLootDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleToolsDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleToolsDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleFoodDrops.GetRandomElement()); loot.GetInventory().CreateEntityInCargo(PossibleFoodDrops.GetRandomElement()); //loot.Close(); int oRandValue = Math.RandomIntInclusive(INT_MIN_ZOMBIES,INT_MAX_ZOMBIES); for (int i = 0; i < oRandValue; ++i) { int rndS1 = Math.RandomIntInclusive(-1,1); float rndX = Math.RandomIntInclusive(5,10) * rndS1; if (rndS1 == 0) { while (rndS1 == 0) { rndS1 = Math.RandomIntInclusive(-1,1); rndX = Math.RandomIntInclusive(5,10) * rndS1; } } else { rndS1 = Math.RandomIntInclusive(-1,1); } float rndY = Math.RandomIntInclusive(5,10) * rndS1; pos1 = SnapToGroundZ(Vector(pos[0] + rndX, pos[1] , pos[2] + rndY)); EntityAI AIzmb = GetGame().CreateObject( ZombieClasses.GetRandomElement(), pos1, false, true ); if (AIzmb) { AIzmb.GetInventory().CreateInInventory("Ssh68Helmet"); } ref ZombieBase Bszmb; Class.CastTo(Bszmb,AIzmb); if (Bszmb) { m_SpawnedZombies.Insert(AIzmb); } } } void CleanUp() { if (Heli) GetGame().ObjectDelete(Heli); if (Chest) GetGame().ObjectDelete(Chest); for (int i = 0; i < m_SpawnedZombies.Count(); ++i) { EntityAI zmb = m_SpawnedZombies.Get(i); GetGame().ObjectDelete(zmb); } m_SpawnedZombies.Clear(); } ref TStringArray PossibleAttachmentsDrops = { "","AK_RailHndgrd","M4_RISHndgrd", "AKS74U_Bttstck","","M4_OEBttstck","", "Fal_FoldingBttstck","Mag_AK101_30Rnd","Mag_AK74_30Rnd", "AKS74U_Bttstck","Mag_AK74_30Rnd","Mag_AKM_30Rnd", "Mag_VSS_10Rnd","ACOGOptic","AK_RailHndgrd", "AK_FoldingBttstck","M4_RISHndgrd","AKS74U_Bttstck", "","","","AKS74U_Bttstck","", "","Mag_AK74_30Rnd","Mag_CMAG_30Rnd", "Mag_VSS_10Rnd","Mag_Saiga_8Rnd","","", "AK_FoldingBttstck","","M4_OEBttstck","", "","Mag_Saiga_5Rnd","Mag_VSS_10Rnd", "AK_FoldingBttstck","M4_OEBttstck","", "","Mag_Saiga_5Rnd","", }; ref TStringArray PossibleAmmosDrops = { "ammo_45acp", "ammo_556x45", "ammo_762x39", "Ammo_545x39","Ammo_12gaSlug","Ammo_545x39", "Ammo_12gaPellets","AmmoBox_556x45_20Rnd", "ammo_762x39","Ammo_12gaPellets","ammo_45acp", "AmmoBox_357_20Rnd","AmmoBox_545x39_20Rnd", "AmmoBox_9x39AP_20Rnd","Ammo_9x39","ammo_45acp", "","ammo_556x45", "AmmoBox_762x39_20Rnd", "Ammo_12gaSlug","","Ammo_545x39","Ammo_12gaSlug", "","Ammo_12gaPellets","AmmoBox_357_20Rnd", "Ammo_9x39","","","Ammo_357","Ammo_357", }; ref TStringArray PossibleClothesDrops = { "NylonKnifeSheath","PlateCarrierHolster", "HuntingJacket_Autumn","HunterPants_Autumn", }; ref TStringArray PossibleClothesDropsMil = { "","MilitaryBelt", "", }; ref TStringArray PossibleToolsDrops = { "","","IO_Radiation_pills","","" }; ref TStringArray PossibleLootDrops = { "BandageDressing","BandageDressing","","","","", }; ref TStringArray PossibleFoodDrops = { "BandageDressing","BandageDressing","","", }; ref array<ref TStringArray> Trophys = { {"M4A1","Mag_CMAG_40Rnd","M4_OEBttstck","M4_RISHndgrd",}, {"M4A1","Mag_CMAG_40Rnd","","M4_OEBttstck","M4_RISHndgrd",}, {"AKM","Mag_AKM_30Rnd","AK_FoldingBttstck","AK_RailHndgrd",}, {"AKM","Mag_AKM_30Rnd","","AK_FoldingBttstck","AK_RailHndgrd",}, {"AK101","Mag_AK101_30Rnd","","AKS74U_Bttstck","AK_RailHndgrd_Black",}, {"AK101","Mag_AK101_30Rnd","","AKS74U_Bttstck","AK_RailHndgrd_Black",}, {"AK74","Mag_AK74_30Rnd","AKS74U_Bttstck","AK74_Hndgrd",}, {"AK74","Mag_AK74_30Rnd","","AKS74U_Bttstck","AK74_Hndgrd",}, }; ref TStringArray ZombieClasses = { "Mutant_AoD_Snork1_Easy","Mutant_AoD_Snork2_Easy", }; vector SnapToGroundZ(vector pos) { float pos_x = pos[0]; float pos_z = pos[2]; float pos_y = GetGame().SurfaceY( pos_x, pos_z ); vector tmp_pos = Vector( pos_x, pos_y, pos_z ); return tmp_pos; } }


ref HeliWreck m_HeliWreck = new HeliWreck();

class HeliWreck 
{
	ref array<EntityAI> m_SpawnedZombies = new array<EntityAI>;	
	EntityAI Heli;
	EntityAI Chest
	const string boxtype = "SeaChest";
	const int spawntime = 1200;  //Время до спавна след. вертолета в сек.
	ref TVectorArray SpawnCoords = {
		"Тут координата"
	}; 
	int INT_MAX_ZOMBIES      	 = 16;     //Макс. кол-во зомби
	int INT_MIN_ZOMBIES       	 = 10;      //Мин. кол-во зомби

	
	void HeliWreck()
	{
		//s_Conf = new SpawnConfig();
		GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(this.SpawnHeli, spawntime * 1000, true);
		GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(this.clearplace, 10000, false);
	}

	void ~HeliWreck()
	{
		
	}
	
	void clearplace()
    {
        for (int i = 0; i < SpawnCoords.Count(); ++i)
        {
            array<Object> PrivateObjects = new array<Object>;    //Объекты в зонах
            array<CargoBase> PrivateCargos = new array<CargoBase>;             
            GetGame().GetObjectsAtPosition3D( SnapToGroundZ(SpawnCoords.Get(i)), 15, PrivateObjects, PrivateCargos);
            for (int j = 0; j < PrivateObjects.Count(); ++j)
            {
                EntityAI tempEnt = EntityAI.Cast(PrivateObjects.Get(j));
                if (tempEnt && (tempEnt.GetType() == boxtype))
                {
					if (PrivateObjects.Get(j) != Chest)
						GetGame().ObjectDelete(PrivateObjects.Get(j));
                }
            }
        }
    }

	void SpawnHeli()
	{
		CleanUp();
		vector pos = SnapToGroundZ(SpawnCoords.GetRandomElement());
		//Heli = GetGame().CreateObject( "land_wrecked_mi8", pos, false, true );
		Heli = GetGame().CreateObject( "Wreck_Mi8_Crashed", Vector(pos[0], pos[1]+1 , pos[2]), false, true );
		TStringArray Trophy	= Trophys.GetRandomElement();
		vector pos1 = SnapToGroundZ(Vector(pos[0] - 3, pos[1] , pos[2] + 1));
		Chest = GetGame().CreateObject(boxtype, pos1, false, true);
		Container_Base loot = Container_Base.Cast(Chest);
		//loot.Open();
		if ( Trophy.Count() > 0 )
		{
			EntityAI trophy = loot.GetInventory().CreateEntityInCargo(Trophy[0]);		
			if (trophy)
			{
				loot.GetInventory().CreateEntityInCargo(Trophy[1]);
				loot.GetInventory().CreateEntityInCargo(Trophy[1]);	
				for (private int j = 2; j < Trophy.Count(); j++)
				{
					loot.GetInventory().CreateEntityInCargo(Trophy[j]);
				}
			}
		}
		loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAttachmentsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleAmmosDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleLootDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleLootDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleToolsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleToolsDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleFoodDrops.GetRandomElement());
		loot.GetInventory().CreateEntityInCargo(PossibleFoodDrops.GetRandomElement());
		//loot.Close();	
		int oRandValue   = Math.RandomIntInclusive(INT_MIN_ZOMBIES,INT_MAX_ZOMBIES);		
		for (int i = 0; i < oRandValue; ++i)
		{
			int rndS1  = Math.RandomIntInclusive(-1,1);
			float rndX  = Math.RandomIntInclusive(5,10) * rndS1;
			if (rndS1 == 0)
			{
				while (rndS1 == 0)
				{
					rndS1  = Math.RandomIntInclusive(-1,1);
					rndX  = Math.RandomIntInclusive(5,10) * rndS1;
				}
			}
			else
			{
				rndS1  = Math.RandomIntInclusive(-1,1);
			}
			float rndY  = Math.RandomIntInclusive(5,10) * rndS1;
			pos1 = SnapToGroundZ(Vector(pos[0] + rndX, pos[1] , pos[2] + rndY));		
			EntityAI AIzmb = GetGame().CreateObject( ZombieClasses.GetRandomElement(), pos1, false, true );
			if (AIzmb) 
			{
				AIzmb.GetInventory().CreateInInventory("Ssh68Helmet");
				
			}
			ref ZombieBase Bszmb;
			Class.CastTo(Bszmb,AIzmb);
			if (Bszmb)
			{
				m_SpawnedZombies.Insert(AIzmb);
			}	
		}		
	}

	void CleanUp()
	{		
		if (Heli) GetGame().ObjectDelete(Heli);
		if (Chest) GetGame().ObjectDelete(Chest);
		for (int i = 0; i < m_SpawnedZombies.Count(); ++i)
		{
			EntityAI zmb = m_SpawnedZombies.Get(i);
			GetGame().ObjectDelete(zmb);
		}
		m_SpawnedZombies.Clear();
	}
	
	ref TStringArray PossibleAttachmentsDrops = {
		"","AK_RailHndgrd","M4_RISHndgrd",
		"AKS74U_Bttstck","","M4_OEBttstck","",
		"Fal_FoldingBttstck","Mag_AK101_30Rnd","Mag_AK74_30Rnd",
		"AKS74U_Bttstck","Mag_AK74_30Rnd","Mag_AKM_30Rnd",		
		"Mag_VSS_10Rnd","ACOGOptic","AK_RailHndgrd",
		"AK_FoldingBttstck","M4_RISHndgrd","AKS74U_Bttstck",
		"","","","AKS74U_Bttstck","",
		"","Mag_AK74_30Rnd","Mag_CMAG_30Rnd",
		"Mag_VSS_10Rnd","Mag_Saiga_8Rnd","","",	
		"AK_FoldingBttstck","","M4_OEBttstck","",
		"","Mag_Saiga_5Rnd","Mag_VSS_10Rnd",
		"AK_FoldingBttstck","M4_OEBttstck","",
		"","Mag_Saiga_5Rnd","",	
	};		
	
	ref TStringArray PossibleAmmosDrops = {
		"ammo_45acp", "ammo_556x45", "ammo_762x39",
		"Ammo_545x39","Ammo_12gaSlug","Ammo_545x39",
		"Ammo_12gaPellets","AmmoBox_556x45_20Rnd",
		"ammo_762x39","Ammo_12gaPellets","ammo_45acp",
		"AmmoBox_357_20Rnd","AmmoBox_545x39_20Rnd",
		"AmmoBox_9x39AP_20Rnd","Ammo_9x39","ammo_45acp",
		"","ammo_556x45", "AmmoBox_762x39_20Rnd",
		"Ammo_12gaSlug","","Ammo_545x39","Ammo_12gaSlug",
		"","Ammo_12gaPellets","AmmoBox_357_20Rnd",
		"Ammo_9x39","","","Ammo_357","Ammo_357",
	};
	
	ref TStringArray PossibleClothesDrops = {
		"NylonKnifeSheath","PlateCarrierHolster",
		"HuntingJacket_Autumn","HunterPants_Autumn",
	};
		
	ref TStringArray PossibleClothesDropsMil = {
		"","MilitaryBelt",
		"",
	};
	
	ref TStringArray PossibleToolsDrops = {
		"","","IO_Radiation_pills","",""
	};	

	ref TStringArray PossibleLootDrops = {
		"BandageDressing","BandageDressing","","","","",
	};

	ref TStringArray PossibleFoodDrops = {
		"BandageDressing","BandageDressing","","",
	};

	ref array<ref TStringArray> Trophys = {
		{"M4A1","Mag_CMAG_40Rnd","M4_OEBttstck","M4_RISHndgrd",},
		{"M4A1","Mag_CMAG_40Rnd","","M4_OEBttstck","M4_RISHndgrd",},
		{"AKM","Mag_AKM_30Rnd","AK_FoldingBttstck","AK_RailHndgrd",},
		{"AKM","Mag_AKM_30Rnd","","AK_FoldingBttstck","AK_RailHndgrd",},
		{"AK101","Mag_AK101_30Rnd","","AKS74U_Bttstck","AK_RailHndgrd_Black",},
		{"AK101","Mag_AK101_30Rnd","","AKS74U_Bttstck","AK_RailHndgrd_Black",},
		{"AK74","Mag_AK74_30Rnd","AKS74U_Bttstck","AK74_Hndgrd",},		
		{"AK74","Mag_AK74_30Rnd","","AKS74U_Bttstck","AK74_Hndgrd",},
	};	
	
	ref TStringArray ZombieClasses = {
		"Mutant_AoD_Snork1_Easy","Mutant_AoD_Snork2_Easy",
	};	

	vector SnapToGroundZ(vector pos)
    {
        float pos_x = pos[0];
        float pos_z = pos[2];
        float pos_y = GetGame().SurfaceY( pos_x, pos_z );
        vector tmp_pos = Vector( pos_x, pos_y, pos_z );
        return tmp_pos;
    }	
}

#include "$CurrentDir:mpmissions\"Тут название папки миссии"\HeliCrash.c"
Сам файл так и должен называться: "HeliCrash.c" (Хотя можешь назвать как угодно)

image.png.7ad275ab325db9621feccd884a01d436.png

А какая кордината должна быть? и что за координаты?

Share this post


Link to post
Share on other sites
  • 0

Координата места, куда будет падать хелик.... 

 

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.