exp32

Спавн игроков

Вопрос

Приветствую.

не могу прописать спавн игроков по координатам и с определенным лутом.

думал так сделать: 

 

{

Entity PlayerEnt;

PlayerBase player = (PlayerBase) playerEnt;

GUID = player.GetIdentity (). GetPlainId (); // Steam 64

player1 = "XXXXXXXXXXXXXXXX" // Бенни

player2 = "XXXXXXXXXXXXXXXX"; // Тони

player3 = "XXXXXXXXXXXXXXXX"; // Данни

player4 = "XXXXXXXXXXXXXXXX"; // Отметить

player5 = "XXXXXXXXXXXXXXXX"; // Ян

экипаж спавн = "2774,92 1278,62";

если (GUID == player1)

{

playerEnt = GetGame (). CreatePlayer (identity, characterName, "2774.92 26.052 1278.62", 0, "NONE"); // Создает случайного игрока

}

иначе если (GUID == player2)

{

playerEnt = GetGame (). CreatePlayer (identity, characterName, "2774.92 26.052 1278.62", 0, "NONE"); // Создает случайного игрока

}

иначе если (GUID == player3)

{

playerEnt = GetGame (). CreatePlayer (identity, characterName, "2774.92 26.052 1278.62", 0, "NONE"); // Создает случайного игрока

}

еще если (GUID == player4)

{

playerEnt = GetGame (). CreatePlayer (identity, characterName, "2774.92 26.052 1278.62", 0, "NONE"); // Создает случайного игрока

}

иначе если (GUID == player5)

{

playerEnt = GetGame (). CreatePlayer (identity, characterName, "2774.92 26.052 1278.62", 0, "NONE"); // Создает случайного игрока

}

еще

{

playerEnt = GetGame (). CreatePlayer (identity, characterName, pos, 0, "NONE"); // Создает случайного игрока

}

Class.CastTo (m_player, playerEnt);

GetGame (). SelectPlayer (identity, m_player);

вернуть m_player;

}

 не помогло. не говоря о прописке лута.

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

4 ответа на этот вопрос

Тема в несоответствующем разделе (Гайды) - перенесено в раздел помощи!

По оформлению темы - код вставлен без тега для вставки кода. 24 часа на исправление!

По поводу самого вопроса и того как делается это уже неоднократно на форуме разжевывал, поиском почему не пользуемся?

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
Забронировать это рекламное место


Как пример…

Листинг fractions.c

class FGCL_PlayerData
{
	int side;
}

ref map<string, ref FGCL_PlayerData> FGV_PlayerList = new map<string, ref FGCL_PlayerData>;

class FGCL_Fractions
{
	
	void FGCL_Fractions()
	{
		FileHandle fp;
		
		fp = OpenFile( "$profile:data\\players.txt", FileMode.READ );
		if( !fp )
		{
			Print("[E] Can't read players list");
			return;
		}
		string buffer = "";
		while( FGets( fp, buffer ) > 0 )
		{
			int elements;
			TStringArray tokens = new TStringArray;
			
			buffer.Split( "|", tokens );
			elements = tokens.Count();
			if( elements > 1 ) {
				ref FGCL_PlayerData player = new FGCL_PlayerData;
				int side;
				string steamid;
				
				side = tokens.Get( 0 ).ToInt();
				steamid = tokens.Get( 1 );
				player.side = side;
				FGV_PlayerList.Set( steamid, player );
			}
		}
		CloseFile( fp );
	}
	
	void ~FGCL_Fractions()
	{
		
	}
	
	static int GetPlayerSide(PlayerIdentity identity)
	{
		FGCL_PlayerData player;
		
		if( !identity )
			return 0;
		
		player = FGV_PlayerList.Get( identity.GetPlainId() );
		if( !player ) {
			Print("[W] GetPlayerSide : No data for " + identity.GetPlainId() );
			Print("PlayerList.Count = " + FGV_PlayerList.Count().ToString() );
			return 0;
		}
		
		return player.side;
	}
	
	static vector GetPos(PlayerIdentity identity, vector pos)
	{
		FileHandle fp;
		FGCL_PlayerData player;
		int side;
		vector newpos;
		string posfilepath;
		
		side = GetPlayerSide( identity );
		if( !side )
			return pos;
		
		posfilepath = "$profile:data\\pos" + side.ToString() + ".txt";
		
		fp = OpenFile( posfilepath, FileMode.READ );
		if( !fp )
		{
			Print("[E] GetPos : Can't open posX.txt");
			return pos;
		}
		TVectorArray poses = new TVectorArray;
		string buffer = "";
		while( FGets( fp, buffer ) > 0 )
		{
			vector tmppos;
			newpos = buffer.ToVector();
			if( newpos )
			{
				poses.Insert( newpos );
			}
		}
		CloseFile(fp);
		
		int elements;
		elements = poses.Count();
		if( !elements )
		{
			return pos;
		}
		
		pos = poses.GetRandomElement();
		
		return pos;
	}
	
	static void EquipPlayer(PlayerBase player)
	{
		int side;
		
		side = GetPlayerSide( player.GetIdentity() );
		if( !side )
		{
			EquipDefault( player );
			return;
		}
		
		if( side == 100 )
			EquipRed( player );
		else if( side == 200 )
			EquipBlue( player );
		else if( side == 300 )
			EquipYellow( player );
		else if( side == 400 )
			EquipDefault( player );
		else if( side == 700 ) // me
			Equip700( player );
		else if( side == 701 ) // admin2
			Equip701( player );
		else if( side == 702 ) // admin3
			Equip702( player );
		else if( side == 703 ) // admin4
			Equip703( player );
		else if( side == 704 ) // admin5
			Equip704( player );
		else if( side == 705 ) // admin6
			Equip705( player );
		else
			EquipDefault( player );
		return;
	}
	
	static void EquipDefault(PlayerBase player)
	{
		GameInventory inv;
		EntityAI itemEnt;
		EntityAI iebag;
		EntityAI ietop;
		EntityAI iepants;
		
		inv = player.GetInventory();

		inv.CreateInInventory("Armband_White");

		TStringArray backpack = {"MountainBag_Red","MountainBag_Blue","MountainBag_Orange","MountainBag_Green"};
		iebag = inv.CreateInInventory(backpack.GetRandomElement());

		TStringArray headgear = {"RadarCap_Black","RadarCap_Blue","RadarCap_Brown","RadarCap_Green","RadarCap_Red"};
		inv.CreateInInventory(headgear.GetRandomElement());
		TStringArray jackets = {"JumpsuitJacket_Blue","JumpsuitJacket_Gray","JumpsuitJacket_Green","JumpsuitJacket_Red"};
		ietop = inv.CreateInInventory(jackets.GetRandomElement());
		TStringArray pants = {"JumpsuitPants_Blue","JumpsuitPants_Green","JumpsuitPants_Grey","JumpsuitPants_Red"};
		iepants = inv.CreateInInventory(pants.GetRandomElement());
		TStringArray shoes = {"HikingBootsLow_Black","HikingBootsLow_Blue","HikingBootsLow_Beige","HikingBootsLow_Grey"};
		inv.CreateInInventory(shoes.GetRandomElement());

		iebag.GetInventory().CreateInInventory("Raincoat_Orange");

		TStringArray knife = {"SteakKnife","HuntingKnife","CombatKnife"};
		iepants.GetInventory().CreateInInventory(knife.GetRandomElement());

		itemEnt = iebag.GetInventory().CreateInInventory("Flashlight");
		itemEnt.GetInventory().CreateAttachment("Battery9V");
		
		ietop.GetInventory().CreateInInventory("OrienteeringCompass");

		TStringArray drink = {"WaterBottle","SodaCan_Cola","SodaCan_Kvass","SodaCan_Pipsi","SodaCan_Spite"};
		iebag.GetInventory().CreateInInventory(drink.GetRandomElement());

		TStringArray food = {"BakedBeansCan","PeachesCan","SpaghettiCan","SardinesCan","TunaCan"};
		iebag.GetInventory().CreateInInventory(food.GetRandomElement());
		iebag.GetInventory().CreateInInventory(food.GetRandomElement());
		
		itemEnt = ietop.GetInventory().CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		player.GetHumanInventory().CreateInHands("Izh18");
		inv.CreateInInventory("AmmoBox_762x39_20Rnd");

		
		switch( Math.RandomInt(0,1) )
		{
			case 0:
			{
				ItemBase itemBs;
				itemEnt = iebag.GetInventory().CreateInInventory("Rag");
				itemBs = ItemBase.Cast(itemEnt);
				itemBs.SetQuantity(4);
				break;
			}
			case 1:
			{
				itemEnt = iebag.GetInventory().CreateInInventory("BandageDressing");
				break;
			}
		}
		
		ietop.GetInventory().CreateInInventory("Matchbox");

		iebag.GetInventory().CreateInInventory("Hatchet");
		
		return;
	}
	
	static void EquipRed(PlayerBase player)
	{
		GameInventory inv;
		EntityAI itemEnt;
		EntityAI ietop;
		EntityAI iepants;
		
		inv = player.GetInventory();
		
		inv.CreateInInventory("Armband_Red");

		inv.CreateInInventory("MilitaryBeret_Red");
		ietop = inv.CreateInInventory("TTsKOJacket_Camo");
		iepants = inv.CreateInInventory("TTSKOPants");
		itemEnt = inv.CreateInInventory("MilitaryBoots_Black");
		itemEnt = itemEnt.GetInventory().CreateInInventory("CombatKnife");

		ietop.GetInventory().CreateInInventory("BandageDressing");
		
		itemEnt = ietop.GetInventory().CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		itemEnt = ietop.GetInventory().CreateInInventory("Flashlight");
		itemEnt.GetInventory().CreateAttachment("Battery9V");
		
		iepants.GetInventory().CreateInInventory("Matchbox");
		
		TStringArray food = {"BakedBeansCan","PeachesCan","TacticalBaconCan","SpaghettiCan","SardinesCan","TunaCan"};
		ietop.GetInventory().CreateInInventory(food.GetRandomElement());
		iepants.GetInventory().CreateInInventory(food.GetRandomElement());

		itemEnt = player.GetHumanInventory().CreateInHands("AKM");
		itemEnt.GetInventory().CreateAttachment("AK_PlasticHndgrd");
		itemEnt.GetInventory().CreateAttachment("AK_PlasticBttstck_Black");
		inv.CreateInInventory("Mag_AKM_30Rnd");
		inv.CreateInInventory("Mag_AKM_30Rnd");
		
		return;
	}
	
	static void EquipBlue(PlayerBase player)
	{
		GameInventory inv;
		EntityAI itemEnt;
		EntityAI ietop;
		EntityAI iepants;
		
		inv = player.GetInventory();
		
		inv.CreateInInventory("Armband_Blue");

		inv.CreateInInventory("MilitaryBeret_UN");
		ietop = inv.CreateInInventory("USMCJacket_Woodland");
		iepants = inv.CreateInInventory("USMCPants_Woodland");
		itemEnt = inv.CreateInInventory("MilitaryBoots_Beige");
		itemEnt = itemEnt.GetInventory().CreateInInventory("CombatKnife");

		ietop.GetInventory().CreateInInventory("BandageDressing");
		
		itemEnt = ietop.GetInventory().CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		itemEnt = ietop.GetInventory().CreateInInventory("Flashlight");
		itemEnt.GetInventory().CreateAttachment("Battery9V");
		
		iepants.GetInventory().CreateInInventory("Matchbox");
		
		TStringArray food = {"BakedBeansCan","PeachesCan","TacticalBaconCan","SpaghettiCan","SardinesCan","TunaCan"};
		ietop.GetInventory().CreateInInventory(food.GetRandomElement());
		iepants.GetInventory().CreateInInventory(food.GetRandomElement());
		
		inv.CreateInInventory("M4_OEBttstck");
		inv.CreateInInventory("M4_MPBttstck");
		inv.CreateInInventory("M4_M4_CQBBttstck");

		itemEnt = player.GetHumanInventory().CreateInHands("M4A1");
		itemEnt.GetInventory().CreateAttachment("M4_OEBttstk");
		itemEnt.GetInventory().CreateAttachment("M4_PlasticHndgrd_Black");
		inv.CreateInInventory("Mag_STANAG_30Rnd");
		inv.CreateInInventory("Mag_STANAG_30Rnd");
		
		return;
	}
	
	static void EquipYellow(PlayerBase player)
	{
		GameInventory inv;
		EntityAI itemEnt;
		EntityAI ietop;
		EntityAI iepants;
		
		inv = player.GetInventory();
		
		inv.CreateInInventory("Armband_Yellow");

		inv.CreateInInventory("ImprovisedBag");

		inv.CreateInInventory("PrisonerCap");
		ietop = inv.CreateInInventory("PrisonUniformJacket");
		iepants = inv.CreateInInventory("PrisonUniformPants");

		TStringArray boots = {"WorkingBoots_Grey","WorkingBoots_Brown","WorkingBoots_Green","WorkingBoots_Yellow","WorkingBoots_Beige"};
		inv.CreateInInventory(boots.GetRandomElement());
		
		iepants.GetInventory().CreateInInventory("HuntingKnife");

		ietop.GetInventory().CreateInInventory("BandageDressing");
		
		itemEnt = ietop.GetInventory().CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		itemEnt = iepants.GetInventory().CreateInInventory("Flashlight");
		itemEnt.GetInventory().CreateAttachment("Battery9V");
		
		ietop.GetInventory().CreateInInventory("Matchbox");
		
		TStringArray drink = {"WaterBottle","Vodka","SodaCan_Pipsi","SodaCan_Cola","SodaCan_Spite","SodaCan_Kvass"};
		ietop.GetInventory().CreateInInventory(drink.GetRandomElement());

		itemEnt = player.GetHumanInventory().CreateInHands("UMP45");
		itemEnt.GetInventory().CreateAttachment("M4_PlasticHndgrd");
		itemEnt.GetInventory().CreateAttachment("M4_MPBttstck");
		inv.CreateInInventory("Mag_UMP_25Rnd");
		
		return;
	}
	
	static void EquipMercenary(PlayerBase player) // Green - Наёмники
	{
		GameInventory inv;
		EntityAI itemEnt;
		EntityAI ietop;
		EntityAI iepants;
		
		inv = player.GetInventory();
		
		inv.CreateInInventory("Armband_Green");

		inv.CreateInInventory("ImprovisedBag");

		inv.CreateInInventory("PrisonerCap");
		ietop = inv.CreateInInventory("PrisonUniformJacket");
		iepants = inv.CreateInInventory("PrisonUniformPants");

		TStringArray boots = {"WorkingBoots_Grey","WorkingBoots_Brown","WorkingBoots_Green","WorkingBoots_Yellow","WorkingBoots_Beige"};
		inv.CreateInInventory(boots.GetRandomElement());
		
		iepants.GetInventory().CreateInInventory("HuntingKnife");

		ietop.GetInventory().CreateInInventory("BandageDressing");
		
		itemEnt = ietop.GetInventory().CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		itemEnt = iepants.GetInventory().CreateInInventory("Flashlight");
		itemEnt.GetInventory().CreateAttachment("Battery9V");
		
		ietop.GetInventory().CreateInInventory("Matchbox");
		
		TStringArray drink = {"WaterBottle","Vodka","SodaCan_Pipsi","SodaCan_Cola","SodaCan_Spite","SodaCan_Kvass"};
		ietop.GetInventory().CreateInInventory(drink.GetRandomElement());

		itemEnt = player.GetHumanInventory().CreateInHands("UMP45");
		itemEnt.GetInventory().CreateAttachment("M4_PlasticHndgrd");
		itemEnt.GetInventory().CreateAttachment("M4_MPBttstck");
		inv.CreateInInventory("Mag_UMP_25Rnd");
		
		return;
	}
	
	static void EquipScientist(PlayerBase player)  // Pink - Учёные
	{
		GameInventory inv;
		EntityAI itemEnt;
		EntityAI ietop;
		EntityAI iebag;
		EntityAI iepants;
		
		inv = player.GetInventory();
		
		inv.CreateInInventory("Armband_Pink");

		iebag = inv.CreateInInventory("TortillaBag");

		inv.CreateInInventory("BaseballCap_Pink");
		inv.CreateInInventory("NBCHoodGray");
		ietop = inv.CreateInInventory("NBCJacketGray");
		iepants = inv.CreateInInventory("NBCPantsGray");
		inv.CreateInInventory("NBCGlovesGray");
		inv.CreateInInventory("NBCBootsGray");
		inv.CreateInInventory("GasMask");
		
		iepants.GetInventory().CreateInInventory("CombatKnife");

		ietop.GetInventory().CreateInInventory("BandageDressing");
		ietop.GetInventory().CreateInInventory("BandageDressing");
		
		itemEnt = ietop.GetInventory().CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		itemEnt = iepants.GetInventory().CreateInInventory("Flashlight");
		itemEnt.GetInventory().CreateAttachment("Battery9V");
		
		ietop.GetInventory().CreateInInventory("Matchbox");
		
		TStringArray drink = {"WaterBottle","Vodka","SodaCan_Pipsi","SodaCan_Cola","SodaCan_Spite","SodaCan_Kvass"};
		iebag.GetInventory().CreateInInventory(drink.GetRandomElement());
		iebag.GetInventory().CreateInInventory(drink.GetRandomElement());

		TStringArray food = {"BakedBeansCan","PeachesCan","SpaghettiCan","SardinesCan","TunaCan"};
		iebag.GetInventory().CreateInInventory(food.GetRandomElement());
		iebag.GetInventory().CreateInInventory(food.GetRandomElement());
		
		itemEnt = player.GetHumanInventory().CreateInHands("CZ61");
		itemEnt.GetInventory().CreateAttachment("AK_Suppressor");
		inv.CreateInInventory("Mag_CZ61_20Rnd");
		inv.CreateInInventory("Mag_CZ61_20Rnd");
		inv.CreateInInventory("AmmoBox_380_35rnd");
		inv.CreateInInventory("AmmoBox_380_35rnd");

		iebag.GetInventory().CreateInInventory("SmallProtectorCase");
		iebag.GetInventory().CreateInInventory("BookFrankenstein");
		
		iebag.GetInventory().CreateInInventory("CharcoalTablets");
		iebag.GetInventory().CreateInInventory("PainkillerTablets");
		iebag.GetInventory().CreateInInventory("TetracyclineAntibiotics");
		iebag.GetInventory().CreateInInventory("Epinephrine");
		iebag.GetInventory().CreateInInventory("Morphine");
		iebag.GetInventory().CreateInInventory("Thermometer");
		iebag.GetInventory().CreateInInventory("Heatpack");
		
		return;
	}
	
	static void EquipAdmin(PlayerBase player) // ADMIN DEFAULT
	{
		GameInventory inv;
		EntityAI itemEnt;
		
		inv = player.GetInventory();

		inv.CreateInInventory("BaseballCap_Cammo");
		inv.CreateInInventory("GorkaPants_Flat");
		inv.CreateInInventory("GorkaEJacket_Flat");
		inv.CreateInInventory("TacticalGloves_Black");
		inv.CreateInInventory("PoliceVest");
		inv.CreateInInventory("AliceBag_Camo");
		inv.CreateInInventory("Armband_Pink");
		inv.CreateInInventory("Armband_Red");
		inv.CreateInInventory("Armband_White");
		inv.CreateInInventory("Armband_Yellow");
		inv.CreateInInventory("Armband_Blue");

		itemEnt = player.GetHumanInventory().CreateInHands("AKM");
		itemEnt.GetInventory().CreateAttachment("AK_PlasticHndgrd");
		itemEnt.GetInventory().CreateAttachment("AK_PlasticBttstck_Black");
		itemEnt.GetInventory().CreateAttachment("AK_Suppressor");
		itemEnt.GetInventory().CreateAttachment("AK_Bayonet");
		player.SetQuickBarEntityShortcut(itemEnt, 1, true);

		inv.CreateInInventory("Mag_AKM_Drum75Rnd_Black");
		inv.CreateInInventory("Mag_AKM_Drum75Rnd_Black");
		inv.CreateInInventory("Mag_AKM_Drum75Rnd_Black");
		itemEnt = inv.CreateInInventory("Mag_AKM_Drum75Rnd_Black");
		player.SetQuickBarEntityShortcut(itemEnt, 2, true);

		inv.CreateInInventory("GP5GasMask");
		inv.CreateInInventory("Canteen");
		inv.CreateInInventory("Canteen");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("PSO1Optic");
		inv.CreateInInventory("KobraOptic");

		itemEnt = inv.CreateInInventory("MilitaryBoots_Black");
		itemEnt = itemEnt.GetInventory().CreateInInventory("CombatKnife");
		player.SetQuickBarEntityShortcut(itemEnt, 3, true);
		
		inv.CreateInInventory("BandageDressing");
		inv.CreateInInventory("BandageDressing");
		
		itemEnt = inv.CreateInInventory("FirefighterAxe_Black");
		player.SetQuickBarEntityShortcut(itemEnt, 0, true);

		itemEnt = inv.CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		inv.CreateInInventory("OrienteeringCompass");
		
		itemEnt = inv.CreateInInventory("Flashlight");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		player.GetStatStamina().Set(1000);
		player.GetStatEnergy().Set(1000);
		player.GetStatWater().Set(1000);
		
		return;
	}
	
	static void Equip700(PlayerBase player) // ELANC
	{
		GameInventory inv;
		EntityAI itemEnt;
		
		inv = player.GetInventory();
		
		inv.CreateInInventory("Armband_Pink");
		inv.CreateInInventory("BalaclavaMask_Pink");
		inv.CreateInInventory("Breeches_Pink");
		inv.CreateInInventory("Raincoat_Pink");
		inv.CreateInInventory("SurgicalGloves_LightBlue");
		inv.CreateInInventory("ReflexVest");
		inv.CreateInInventory("MountainBag_Red");

		inv.CreateInInventory("GP5GasMask");
		inv.CreateInInventory("Canteen");
		inv.CreateInInventory("Canteen");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");

		itemEnt = inv.CreateInInventory("MilitaryBoots_Redpunk");
		itemEnt = itemEnt.GetInventory().CreateInInventory("CombatKnife");
		player.SetQuickBarEntityShortcut(itemEnt, 2, true);
		
		inv.CreateInInventory("BandageDressing");
		inv.CreateInInventory("BandageDressing");
		
		itemEnt = inv.CreateInInventory("FirefighterAxe");
		player.SetQuickBarEntityShortcut(itemEnt, 0, true);

		itemEnt = inv.CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		itemEnt = inv.CreateInInventory("Megaphone");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		inv.CreateInInventory("OrienteeringCompass");

		player.GetHumanInventory().CreateInHands("Bear_Pink");

		player.GetStatStamina().Set(1000);
		player.GetStatEnergy().Set(1000);
		player.GetStatWater().Set(1000);
		
		return;
	}
	
	static void Equip701(PlayerBase player) // DMISER
	{
		GameInventory inv;
		EntityAI itemEnt;
		
		inv = player.GetInventory();

		inv.CreateInInventory("Armband_Yellow");
		inv.CreateInInventory("BallisticHelmet_Black");
		inv.CreateInInventory("GorkaPants_Flat");
		inv.CreateInInventory("GorkaEJacket_Flat");
		inv.CreateInInventory("TacticalGloves_Black");
		inv.CreateInInventory("SmershVest");
		inv.CreateInInventory("SmershBag");

		itemEnt = player.GetHumanInventory().CreateInHands("AKM");
		itemEnt.GetInventory().CreateAttachment("AK_PlasticHndgrd");
		itemEnt.GetInventory().CreateAttachment("AK_PlasticBttstck_Black");
		itemEnt.GetInventory().CreateAttachment("AK_Suppressor");
		itemEnt.GetInventory().CreateAttachment("AK_Bayonet");
		player.SetQuickBarEntityShortcut(itemEnt, 1, true);

		inv.CreateInInventory("Mag_AKM_Drum75Rnd_Black");
		inv.CreateInInventory("Mag_AKM_Drum75Rnd_Black");
		inv.CreateInInventory("Mag_AKM_Drum75Rnd_Black");
		inv.CreateInInventory("Mag_AKM_Drum75Rnd_Black");
		inv.CreateInInventory("Mag_AKM_Drum75Rnd_Black");
		itemEnt = inv.CreateInInventory("Mag_AKM_Drum75Rnd_Black");
		player.SetQuickBarEntityShortcut(itemEnt, 2, true);

		inv.CreateInInventory("GP5GasMask");
		inv.CreateInInventory("Canteen");
		inv.CreateInInventory("Canteen");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("PSO1Optic");
		inv.CreateInInventory("KobraOptic");

		itemEnt = inv.CreateInInventory("MilitaryBoots_Black");
		itemEnt = itemEnt.GetInventory().CreateInInventory("CombatKnife");
		player.SetQuickBarEntityShortcut(itemEnt, 3, true);
		
		inv.CreateInInventory("BandageDressing");
		inv.CreateInInventory("BandageDressing");
		
		itemEnt = inv.CreateInInventory("FirefighterAxe");
		player.SetQuickBarEntityShortcut(itemEnt, 0, true);

		itemEnt = inv.CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		inv.CreateInInventory("OrienteeringCompass");
		
		itemEnt = inv.CreateInInventory("Flashlight");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		player.GetStatStamina().Set(1000);
		player.GetStatEnergy().Set(1000);
		player.GetStatWater().Set(1000);
		
		return;
	}
	
	static void Equip702(PlayerBase player) // DEVIL
	{
		GameInventory inv;
		EntityAI itemEnt;
		
		inv = player.GetInventory();

		inv.CreateInInventory("Armband_Blue");
		inv.CreateInInventory("BalaclavaMask_Black");
		inv.CreateInInventory("M65Jacket_Black");
		inv.CreateInInventory("CargoPants_Black");
		inv.CreateInInventory("HighCapacityVest_Black");

		itemEnt = player.GetHumanInventory().CreateInHands("AKM");
		itemEnt.GetInventory().CreateAttachment("AK_PlasticHndgrd");
		itemEnt.GetInventory().CreateAttachment("AK_PlasticBttstck_Black");
		itemEnt.GetInventory().CreateAttachment("AK_Suppressor");
		itemEnt.GetInventory().CreateAttachment("AK_Bayonet");
		itemEnt.GetInventory().CreateAttachment("PSO1Optic");
		player.SetQuickBarEntityShortcut(itemEnt, 1, true);

		itemEnt = inv.CreateInInventory("Mag_AKM_Drum75Rnd_Black");
		player.SetQuickBarEntityShortcut(itemEnt, 2, true);
		inv.CreateInInventory("AmmoBox_762x39_20Rnd");
		inv.CreateInInventory("AmmoBox_762x39_20Rnd");
		inv.CreateInInventory("AmmoBox_762x39_20Rnd");

		inv.CreateInInventory("Canteen");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");

		itemEnt = inv.CreateInInventory("MilitaryBoots_Beige");
		itemEnt = itemEnt.GetInventory().CreateInInventory("CombatKnife");
		player.SetQuickBarEntityShortcut(itemEnt, 3, true);
		
		inv.CreateInInventory("BandageDressing");
		inv.CreateInInventory("BandageDressing");
		
		itemEnt = inv.CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		inv.CreateInInventory("MatchBox");
		
		itemEnt = inv.CreateInInventory("Flashlight");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		player.GetStatStamina().Set(1000);
		player.GetStatEnergy().Set(1000);
		player.GetStatWater().Set(1000);
		
		return;
	}

	static void Equip703(PlayerBase player) // LITSEDEY - 1 (WHITE)
	{
		GameInventory inv;
		EntityAI itemEnt;
		EntityAI iebag;
		EntityAI ietop;
		EntityAI iepants;
		
		inv = player.GetInventory();

		inv.CreateInInventory("Armband_White");

		TStringArray backpack = {"MountainBag_Red","MountainBag_Blue","MountainBag_Orange","MountainBag_Green"};
		iebag = inv.CreateInInventory(backpack.GetRandomElement());

		TStringArray headgear = {"RadarCap_Black","RadarCap_Blue","RadarCap_Brown","RadarCap_Green","RadarCap_Red"};
		inv.CreateInInventory(headgear.GetRandomElement());
		TStringArray jackets = {"JumpsuitJacket_Blue","JumpsuitJacket_Gray","JumpsuitJacket_Green","JumpsuitJacket_Red"};
		ietop = inv.CreateInInventory(jackets.GetRandomElement());
		TStringArray pants = {"JumpsuitPants_Blue","JumpsuitPants_Green","JumpsuitPants_Grey","JumpsuitPants_Red"};
		iepants = inv.CreateInInventory(pants.GetRandomElement());
		TStringArray shoes = {"HikingBootsLow_Black","HikingBootsLow_Blue","HikingBootsLow_Beige","HikingBootsLow_Grey"};
		inv.CreateInInventory(shoes.GetRandomElement());

		iebag.GetInventory().CreateInInventory("Raincoat_Orange");

		TStringArray knife = {"SteakKnife","HuntingKnife","CombatKnife"};
		iepants.GetInventory().CreateInInventory(knife.GetRandomElement());

		itemEnt = iebag.GetInventory().CreateInInventory("Flashlight");
		itemEnt.GetInventory().CreateAttachment("Battery9V");
		
		ietop.GetInventory().CreateInInventory("OrienteeringCompass");

		TStringArray drink = {"WaterBottle","SodaCan_Cola","SodaCan_Kvass","SodaCan_Pipsi","SodaCan_Spite"};
		iebag.GetInventory().CreateInInventory(drink.GetRandomElement());

		TStringArray food = {"BakedBeansCan","PeachesCan","SpaghettiCan","SardinesCan","TunaCan"};
		iebag.GetInventory().CreateInInventory(food.GetRandomElement());
		iebag.GetInventory().CreateInInventory(food.GetRandomElement());
		
		itemEnt = ietop.GetInventory().CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		switch( Math.RandomInt(0,1) )
		{
			case 0:
			{
				ItemBase itemBs;
				itemEnt = iebag.GetInventory().CreateInInventory("Rag");
				itemBs = ItemBase.Cast(itemEnt);
				itemBs.SetQuantity(4);
				break;
			}
			case 1:
			{
				itemEnt = iebag.GetInventory().CreateInInventory("BandageDressing");
				break;
			}
		}
		
		ietop.GetInventory().CreateInInventory("Matchbox");

		iebag.GetInventory().CreateInInventory("Hatchet");

		itemEnt = player.GetHumanInventory().CreateInHands("AKM");
		itemEnt.GetInventory().CreateAttachment("AK_PlasticHndgrd");
		itemEnt.GetInventory().CreateAttachment("AK_PlasticBttstck_Black");
		itemEnt.GetInventory().CreateAttachment("AK_Suppressor");
		itemEnt.GetInventory().CreateAttachment("AK_Bayonet");
		player.SetQuickBarEntityShortcut(itemEnt, 1, true);

		itemEnt = inv.CreateInInventory("Mag_AKM_30Rnd");
		player.SetQuickBarEntityShortcut(itemEnt, 2, true);
		inv.CreateInInventory("Mag_AKM_30Rnd");

		player.GetStatStamina().Set(1000);
		player.GetStatEnergy().Set(1000);
		player.GetStatWater().Set(1000);
		
		return;
	}

	static void Equip704(PlayerBase player) // LITSEDEY - 2 (RED)
	{
		GameInventory inv;
		EntityAI itemEnt;
		
		inv = player.GetInventory();

		inv.CreateInInventory("GorkaHelmetComplete");
		inv.CreateInInventory("TTsKOJacket_Camo");
		inv.CreateInInventory("TTSKOPants");
		inv.CreateInInventory("TacticalGloves_Black");
		inv.CreateInInventory("PlateCarrierVest");
		inv.CreateInInventory("AliceBag_Camo");
		inv.CreateInInventory("Armband_Red");

		itemEnt = player.GetHumanInventory().CreateInHands("SVD");
		player.SetQuickBarEntityShortcut(itemEnt, 1, true);

		inv.CreateInInventory("Mag_SVD_10Rnd");
		inv.CreateInInventory("Mag_SVD_10Rnd");
		inv.CreateInInventory("Mag_SVD_10Rnd");
		itemEnt = inv.CreateInInventory("Mag_SVD_10Rnd");
		player.SetQuickBarEntityShortcut(itemEnt, 2, true);

		inv.CreateInInventory("PSO1Optic");
		inv.CreateInInventory("KobraOptic");

		itemEnt = inv.CreateInInventory("KazuarOptic");
		itemEnt.GetInventory().CreateAttachment("Battery9V");
		
		inv.CreateInInventory("SportGlasses_Green");
		inv.CreateInInventory("MilitaryBeret_Red");
		inv.CreateInInventory("GP5GasMask");
		inv.CreateInInventory("Canteen");
		inv.CreateInInventory("Canteen");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		inv.CreateInInventory("TacticalBaconCan");
		
		itemEnt = inv.CreateInInventory("MilitaryBoots_Black");
		itemEnt = itemEnt.GetInventory().CreateInInventory("CombatKnife");
		player.SetQuickBarEntityShortcut(itemEnt, 3, true);
		
		inv.CreateInInventory("BandageDressing");
		inv.CreateInInventory("BandageDressing");
		inv.CreateInInventory("Binoculars");
		
		itemEnt = inv.CreateInInventory("FirefighterAxe_Black");
		player.SetQuickBarEntityShortcut(itemEnt, 0, true);

		itemEnt = inv.CreateInInventory("PersonalRadio");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		inv.CreateInInventory("Compass");
		
		itemEnt = inv.CreateInInventory("Flashlight");
		itemEnt.GetInventory().CreateAttachment("Battery9V");

		inv.CreateInInventory("AmmoBox_762x54_20Rnd");
		inv.CreateInInventory("AmmoBox_762x54_20Rnd");
		inv.CreateInInventory("AmmoBox_762x54_20Rnd");
		inv.CreateInInventory("AmmoBox_762x54_20Rnd");
		inv.CreateInInventory("AmmoBox_762x54_20Rnd");
		inv.CreateInInventory("AmmoBox_762x54_20Rnd");
		inv.CreateInInventory("AmmoBox_762x54_20Rnd");
		inv.CreateInInventory("AmmoBox_762x54_20Rnd");
		inv.CreateInInventory("AmmoBox_762x54_20Rnd");
		inv.CreateInInventory("AmmoBox_762x54_20Rnd");
		
		player.GetStatStamina().Set(1000);
		player.GetStatEnergy().Set(1000);
		player.GetStatWater().Set(1000);
		
		return;
	}	

	static void Equip705(PlayerBase player) // LITSEDEY - 3 
	{
		EquipAdmin(player);
	}	
}

ref FGCL_Fractions FGCTRL_Fractions = new FGCL_Fractions();

Листинг init.c

#include "$CurrentDir:mpmissions\\dayzOffline.chernarusplus\\fas_fractions.c"

...
  
class CustomMission: MissionServer
{
  ...
  override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
  {
    Entity playerEnt;

    pos = FGCTRL_Fractions.GetPos( identity, pos );

    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();
    FGCTRL_Fractions.EquipPlayer( player );
  }
  ...
}

Пример players.txt

700|76561187991212400|ADMIN
701|76561188041751500|ADMIN2
702|76561188008238500|ADMIN3
703|76561187996493400|ADMIN4
704|76561188167965500|ADMIN5
705|76561188217116600|ADMIN6
100|76561198141682900|Player1 [R]
100|76561198147854200|Player2 [R]
100|76561198169514100|Player3 [R]
200|76561198035216311|Vasya [N] 
200|76561198044881811|Petya [N]
200|76561198053485211|Roma [N] 
...
400|76561198242431700|Player50 [W]
400|76561198248912500|Player51 [W]
400|76561198230455600|Player52 [W]

Пример pos100.txt (точки спавна для фракции с id 100)

12099.0 0.0 7270.0
12205.0 0.0 7275.0

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

elanc приветствую подскажите как прописать в вашем способе определённому Id игрока два комплекта экипировки 

P.S. Примерно чтоб один комплект чёрный был милитари сет а второй зелёный ну или же какой то другой 

Изменено пользователем PJIIOxa (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

elanc подскажи как сделать что бы были прописаны в init.c сеты для кепок и чтоб работали сеты которые указаны в вашем скрипте. Они так то работают только вот при появлении в определенном сете экипировки появляются лишние шмотки в инвентаре которые прописаны в init.c

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Создайте аккаунт или войдите в него для комментирования

Вы должны быть пользователем, чтобы оставить комментарий

Создать аккаунт

Зарегистрируйтесь для получения аккаунта. Это просто!


Зарегистрировать аккаунт

Войти

Уже зарегистрированы? Войдите здесь.


Войти сейчас