Перейти к публикации
Поиск в
  • Дополнительно...
Искать результаты, содержащие...
Искать результаты в...
  • Нужна помощь?

    Создайте тему в соответствующем разделе
    Не нужно писать всё в чат!
  • Загляните на торговую площадку

    Там вы можете купить
    всё что касается игровых серверов
  • Не хотите бан?

    Пожалуйста, ознакомьтесь с нашими правилами
    Не нарушайте порядок!
  • Продаёте или покупаете?

    Пользуйтесь услугами гаранта
    Мы сделаем вашу сделку безопасной
  • 1
Eaqqi

Ошибка игрок не был создан на этом сервере dayz

Накатил локалку. прописал всё и всё норм кайф вроде бы. но захожу на сервак и вижу эту ошибку: Ошибка игрок не был создан на этом сервере. 

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


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

Рекомендованные сообщения

  • 1
6 минут назад, dark_kynep сказал:

 

Кидаю свой вариант фикса и инструкцю к нему. Если что, спрашивайте. У меня работает нормально.
 

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

 

 

 

 

Попробуй мой вариант! Только свои сеты пропиши.

Спасибо большое. Чтобы добавить сет надо перепаковывать PBO?

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


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

Нужно убрать/отключить:
"Персональный скин, точка спавна, и сет с лутом при респавне, стартовый лут для всех!"
И все заработает, проблема в этом.

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


Ссылка на сообщение
Поделиться на других сайтах
  • 0
1 час назад, darthcrich сказал:

Нужно убрать/отключить:
"Персональный скин, точка спавна, и сет с лутом при респавне, стартовый лут для всех!"
И все заработает, проблема в этом.


Все заработало, спасибо! А как пофиксить этот момент? Хочется все же чтоб раздача лута работала...

 

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


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

Так вышел же фикс еще вчера, там конечно есть свои нюансы - но лучшего решения пока нет.

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


Ссылка на сообщение
Поделиться на других сайтах
  • 0
14 минут назад, dark_kynep сказал:


Все заработало, спасибо! А как пофиксить этот момент? Хочется все же чтоб раздача лута работала...

 

скинул, где брать фикс в ЛС

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


Ссылка на сообщение
Поделиться на других сайтах
  • 0
55 минут назад, LEET сказал:

скинул, где брать фикс в ЛС

 

Нифига там нет... правила и верифи и все, не написать не прочитать.

 

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


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

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

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


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

Добрый день, можете мне тоже скинуть где взять фикс пожалуйста

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


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

Тоже надо, пожалуйста ? 

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


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

Со мной поделитесь тоже пожалуйста ?

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


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

скиньте сюда фикс, чтобы все видели. Что за приколы в ЛС кидать, не позорьте комьюнити

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


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

В общем, да. Дело было в Custom Spawn. Выпиливайте его с сервера и ищите похожий другой мод если нужны кастомные сеты или спавны (я просто удалил, замену не искал). Я прописал в Init.c спавн точку для всех + стартовый лут. Мне этого хватило.

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


Ссылка на сообщение
Поделиться на других сайтах
  • 0
11 часов назад, Дизайнер сказал:

скиньте сюда фикс, чтобы все видели. Что за приколы в ЛС кидать, не позорьте комьюнити

 

Кидаю свой вариант фикса и инструкцю к нему. Если что, спрашивайте. У меня работает нормально.
 

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

 

 

26.02.2025 в 11:31, grobl сказал:

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

 

 

Попробуй мой вариант! Только свои сеты пропиши.

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

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


Ссылка на сообщение
Поделиться на других сайтах
  • 0
Только что, Дизайнер сказал:

Спасибо большое. Чтобы добавить сет надо перепаковывать PBO?

Ничего не нужно перепаковывать. Просто почитайте инструкцию и сделайте как указано.

 

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

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


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

Ну фикс нормальный! Только я не могу догнать как прописать спавн дефолтный в 1й точке.

В моде это выглядело так: 

player.SetPosition("4967.792969, 104.242012, 329.622406") 

Теперь сервер на эту строчку ругается.

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

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


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

Все вроде разобрался. За фикс огромное спасибо и + в карму.

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


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

Неа нифига так не работает 

default: //Default starting spawn set (Сет поумолчанию для всех игроков, в случае если ни один из сетов выше не выпал.
			{
				player.RemoveAllItems();
				
				
				itemCreated = NULL;															
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Boots");	                // Выдаем игроку обувь
				itemCreated = NULL;															
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Pants");		        // Выдаем игроку Щтаны
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Sweeter");		        // Выдаем игроку свитер
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Roadflare");	                    // Выдаем игроку фальшфеер в любой свободный слот в инвентаре
				itemCreated = NULL;															            // Обнуляем значение переменной											
				itemCreated = player.GetInventory().CreateInInventory("XS_FOOD_CANNED_bstew");	                    // Выдаем игроку банку тушенки
				itemCreated = NULL;	
				itemCreated = player.GetInventory().CreateInInventory("SodaCan_cola");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("CombatKnife");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Sawedoffizh18Shotgun");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = NULL;
				private array <vector>  spawnpoints = {"4967.792969 104.242012 329.622406"};
				private vector selected_spawnpoint = spawnpoints.GetRandomElement();
				player.SetPosition(selected_spawnpoint);
				break;
			}

 

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


Ссылка на сообщение
Поделиться на других сайтах
  • 0
14 минут назад, ArsNet сказал:

 


				private array <vector>  spawnpoints = {"4967.792969 104.242012 329.622406"};
				player.SetPosition(spawnpoints);

Вот так пробуй.

В файле Script.c, в самом начале, надо включить спавн поинты:


    private bool enabled_loading_custom_spawnpoints = false;
    private bool enabled_loading_custom_sets = true; 
    private bool enabled_loading_custom_skins = false; 

Поставить true.

 

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

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


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

Руки из жопы но мы не сдаемся.

Ругается на параметр spownpoints в строке 271. Че я не так то делаю не пойму.



class StartSetsPlayersConfig
{
	private bool enabled_loading_custom_spawnpoints = true;
    private bool enabled_loading_custom_sets = true; 
    private bool enabled_loading_custom_skins = false; 	
	
	void StartSetsPlayer(PlayerBase player,int use_set_id)
	{
		EntityAI itemCreated = NULL;
		EntityAI itemCreated1 = NULL;
		ItemBase itemCasted = NULL;
		EntityAI itemClothing;
		EntityAI itemEnt;
		EntityAI itemBs;
		float rand;
		
		switch( use_set_id ) //Раздаем лут (можно использовать значения от 1 и выше, только не 0 и не -1)
		{
			case 1: //Set with number 1 (Сет с номером 1)
			{
				RemoveAllItems(player); 												// Чтобы удалить с персонажа уже имеющиеся стандартные стартовые шмотки раскомментировать строку
				itemCreated = player.GetInventory().CreateInInventory("FS_HuntBag_co"); 	        // Выдаем рюкзак и записываем в переменную itemCreated
				if (itemCreated)															            
					{
						itemCreated.GetInventory().CreateInInventory("Battery9v");
						itemCreated1 = itemCreated.GetInventory().CreateInInventory("Battery9v");
						if (itemCreated1)
						{
							player.SetQuickBarEntityShortcut(itemCreated1, 4);
						}

					}
				itemCreated = NULL;
				itemCreated1 = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("DSS_Starosta");            	    // Выдаем игроку маску
			    itemCreated = player.GetInventory().CreateInInventory("FS_ForestOldCap");		        // Выдаем игроку перчатки
				itemCreated = player.GetInventory().CreateInInventory("XS_EQP_PANTS_Ironsightpants_naf");		    // Выдаем игроку штаны
				itemCreated = player.GetInventory().CreateInInventory("SFP_SurvScav_Tors");	            // Выдаем игроку обувь
				itemCreated = player.GetInventory().CreateInInventory("RusFlex_BeltUnloading_BAG");	        // Выдаем игроку куртку				
				itemCreated = player.GetInventory().CreateInInventory("RusFlex_MaskaFace_olive"); 	            // Выдаем броню
				itemCreated = player.GetInventory().CreateInInventory("Headtorch_Grey"); 	                // Выдаем ремень
				itemCreated = player.GetInventory().CreateInInventory("WoolGlovesFingerless_Green");
				itemCreated = player.GetInventory().CreateInInventory("XS_EQP_SHOES_wolverineBoots");				
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");	            // Выдаем игроку магазины к AKM в любой свободный слот в инвентаре
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("SFP_ArmyRadio169");
				itemCreated = player.GetInventory().CreateInInventory("SFP_CantenUssr");
				itemCreated = player.GetInventory().CreateInInventory("Justice_HuntingKnife");
				itemCreated = NULL;					
				
				itemCreated = player.GetInventory().CreateInInventory("St_W_BenelliM4");
				if (itemCreated)															            // Проверяем, создался ли ремень. Если он создался, переменная itemCreated будет не пуста и проверка пройдет
				{  	itemCreated.GetInventory().CreateAttachment( "St_O_Holosight" ); 				        // Выдаем игроку на AKM оптику ПСО 11 и крепим
					itemCreated.GetInventory().CreateAttachment( "anpeq_black" ); 			        // Выдаем игроку на AKM цевье, приклад и глушитель, и крепим
					itemCreated.GetInventory().CreateAttachment( "St_M_Salvo12_Suppressor" );
					itemCreated.GetInventory().CreateAttachment( "St_M_Salvo12_Suppressor" );					// Выдаем игроку на AKM цевье, приклад и глушитель, и крепим
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
				}
				itemCreated = NULL;
				itemCreated1 = NULL;
				//itemCasted = ItemBase.Cast(itemCreated);									            // Строка не нужна, закоментирована. используется для изменения класса EntityAI в ItemBase (чтобы нужные операции были доступны)

				
				
				itemCreated = player.GetInventory().CreateInInventory("PersonalRadio");
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 6);
					itemCreated.GetInventory().CreateInInventory( "Battery9V" );
				}
				itemCreated = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("FieldShovel");
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 5);
				}
				itemCreated = NULL;
				break;
			}
			
			case 2: //Set with number 2 (Сет с номером 2)
			{
				RemoveAllItems(player); 												// Чтобы удалить с персонажа уже имеющиеся стандартные стартовые шмотки раскомментировать строку
				itemCreated = player.GetInventory().CreateInInventory("AssaultBag_Ttsko"); 	        // Выдаем рюкзак и записываем в переменную itemCreated
				itemCreated = NULL;
				itemCreated1 = NULL;				

		        itemCreated = player.GetInventory().CreateInInventory("Mich2001Helmet");            	        // Выдаем игроку головной убор
				if (itemCreated)
				{
					itemCreated1 = itemCreated.GetInventory().CreateAttachment("NVGoggles");
					if (itemCreated1)
					{  			            
						itemCreated1.GetInventory().CreateInInventory( "Battery9V" );
					}
					itemCreated1 = itemCreated.GetInventory().CreateAttachment("UniversalLight");
					if (itemCreated1)
					{  			            
						itemCreated1.GetInventory().CreateInInventory( "Battery9V" );
					}					
				}
				itemCreated = NULL;
				itemCreated1 = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("BalaclavaMask_Blackskull");            	    // Выдаем игроку маску
			    itemCreated = player.GetInventory().CreateInInventory("TacticalGloves_Green");		        // Выдаем игроку перчатки
				itemCreated = player.GetInventory().CreateInInventory("BDUPants");		    // Выдаем игроку штаны
				itemCreated = player.GetInventory().CreateInInventory("MilitaryBoots_Black");	            // Выдаем игроку обувь
				itemCreated = player.GetInventory().CreateInInventory("BDUJacket");	        // Выдаем игроку куртку							
				itemCreated = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("PlateCarrierVest_Camo"); 	            // Выдаем броню
				if (itemCreated)															            // Проверяем, создаласи ли броня. Если он создался, переменная itemCreated будет не пуста и проверка пройдет
				{                                                                                       
					itemCreated.GetInventory().CreateAttachment( "PlateCarrierHolster_Camo" ); 			    // Выдаем кобуру и крепим
					itemCreated.GetInventory().CreateAttachment( "PlateCarrierPouches_Camo" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					
				}
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("MilitaryBelt"); 	                // Выдаем ремень
				if (itemCreated)															            // Проверяем, создался ли ремень. Если он создался, переменная itemCreated будет не пуста и проверка пройдет
				{  
					itemCreated.GetInventory().CreateAttachment( "PlateCarrierHolster_Camo" ); 		        // Выдаем кобуру и крепим
					if (itemCreated)
					{
						itemCreated1 = itemCreated.GetInventory().CreateInInventory ("MKII");
						if (itemCreated1)
						{
							player.SetQuickBarEntityShortcut(itemCreated1, 2);
						}
					}
					itemCreated.GetInventory().CreateAttachment( "NylonKnifeSheath" ); 			        // Выдаем ножны и крепим
					if (itemCreated)
					{
						itemCreated1 = itemCreated.GetInventory().CreateInInventory ("CombatKnife");
						if (itemCreated1)
						{
							player.SetQuickBarEntityShortcut(itemCreated1, 3);
						}
					}
				}
				itemCreated = NULL;
				itemCreated1 = NULL;
				//itemCasted = ItemBase.Cast(itemCreated);									            // Строка не нужна, закоментирована. используется для изменения класса EntityAI в ItemBase (чтобы нужные операции были доступны)
				itemCreated = player.GetInventory().CreateInInventory("TacticalGoggles");	            // Выдаем игроку магазины к MKII
				itemCreated = player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");	            // Выдаем игроку магазины к MKII
				itemCreated = player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");	            // Выдаем игроку магазины к MKII
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");		            // Выдаем игроку магазины к AKM в любой свободный слот в инвентаре
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");		            // Выдаем игроку магазины к AKM в любой свободный слот в инвентаре
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");				// Выдаем игроку магазины к AKM в любой свободный слот в инвентаре		
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");

				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");

				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");

				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_22_50Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_22_50Rnd");
				
				itemCreated = NULL;

				itemCreated = player.GetInventory().CreateInInventory("SVD");
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 1);
					itemCreated.GetInventory().CreateAttachment( "AK_Suppressor" );
					itemCreated.GetInventory().CreateAttachment( "PSO1Optic" );
					if (itemCreated)
					{  			            
						itemCreated.GetInventory().CreateInInventory( "Battery9V" );
					} 			           
				}						
							
				itemCreated = NULL;															            // Обнуляем значение переменной после работы с ней, нужно если мы будем использовать ее далее
				itemCreated = player.GetHumanInventory().CreateInHands("VSS");				            // Выдаем игроку AKM в руки
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 0);
					itemCreated.GetInventory().CreateAttachment( "PSO11Optic" );
					if (itemCreated)
					{  			            
						itemCreated.GetInventory().CreateInInventory( "Battery9V" );
					} 			           
				}
				
				itemCreated = NULL;
				itemCreated1 = NULL;
				
				player.GetStatWater().Set(5000);
				player.GetStatEnergy().Set(19000);

					
				break;
			}
			
			case 3: //Set with number 3   (Сет с номером 3)
			{
				break;
			}
			
			case 4: //Set with number 4   (Сет с номером 4)
			{
				break;
			}
			
			case 5: //Set with number 5   (Сет с номером 5)
			{
				break;
			}
			
			case 6: //Set with number 6   (Сет с номером 6)
			{
				break;
			}
			
			default: //Default starting spawn set (Сет поумолчанию для всех игроков, если хотите назначить - добавляйте здесь!)
			{
				//My_Custom_Spawn_Parameters.RemoveAllItems(player); // Чтобы удалить с персонажа уже имеющиеся стандартные стартовые шмотки раскомментировать строку
				DefaultSets(player); // Для выдачи своих сетов по рандому всем игрокам, не прописанным в скрипте, раскомментировать эту строку
				
				itemCreated = NULL;															
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Boots");	                // Выдаем игроку обувь
				itemCreated = NULL;															
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Pants");		        // Выдаем игроку Щтаны
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Sweeter");		        // Выдаем игроку свитер
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Roadflare");	                    // Выдаем игроку фальшфеер в любой свободный слот в инвентаре
				itemCreated = NULL;															            // Обнуляем значение переменной											
				itemCreated = player.GetInventory().CreateInInventory("XS_FOOD_CANNED_bstew");	                    // Выдаем игроку банку тушенки
				itemCreated = NULL;	
				itemCreated = player.GetInventory().CreateInInventory("SodaCan_cola");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("CombatKnife");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Sawedoffizh18Shotgun");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = NULL;
				
				private array <vector>  spawnpoints = {"4967.792969 104.242012 329.622406"};
				player.SetPosition(spawnpoints);
				
				
				break;
			}
		}
	}
	
	void SetRandomHealthItem(EntityAI itemCreated) // Функция генерирует и применяет для предмета рандомное значение здоровья!
	{
		if ( itemCreated )
		{
			private int rndHlt = Math.RandomInt(55,6);
			itemCreated.SetHealth("","",rndHlt);
		}
	}
	
	void DefaultSets(PlayerBase player) // Функция выдает сеты игрокам, не прописанным в конфигурации скрипта!!!
	{
		EntityAI itemCreated = NULL;
		EntityAI itemCreated1 = NULL;
		ItemBase itemCasted = NULL;
		
				private array <vector>  spawnpoints = {"4967.792969 104.242012 329.622406"};
				player.SetPosition(spawnpoints);
		
		
	}
	void RemoveAllItems(PlayerBase player)
    {
        array<EntityAI> itemsArray = new array<EntityAI>;
        ItemBase item;
        player.GetInventory().EnumerateInventory(InventoryTraversalType.PREORDER, itemsArray);
        
        for (int i = 0; i < itemsArray.Count(); i++)
        {
            Class.CastTo(item, itemsArray.Get(i));
            if (item && !item.IsInherited(SurvivorBase))
            {
                InventoryLocation il = new InventoryLocation();
                if (item && item.GetInventory().GetCurrentInventoryLocation(il))
                {
                    player.GetInventory().LocalDestroyEntity(item);
                }
            }
        }
    }
}

Вот эта строка получается:

player.SetPosition(spawnpoints);

Писал уже и так результат тотже:

	private bool enabled_loading_custom_spawnpoints = true;
    private bool enabled_loading_custom_sets = true; 
    private bool enabled_loading_custom_skins = false; 	

class StartSetsPlayersConfig
{

 

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

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


Ссылка на сообщение
Поделиться на других сайтах
  • 0
8 минут назад, ArsNet сказал:

Руки из жопы но мы не сдаемся.

 

Читай внимательно!
В файле Script.c, в самом начале, надо включить спавн поинты:

    

private bool enabled_loading_custom_spawnpoints = true;
private bool enabled_loading_custom_sets = true;
private bool enabled_loading_custom_skins = false; 

Нужно открыть этот файл и поменять false на true! А ты, эти строки, зачем-то вставил в файл Sets.c.


Далее, в файле Сетс, перед тем как виписывать лут, в функции Default или где там еще, вставляешь:
 

private vector selected_spawnpoint = "7500 0 7500"; //тут свои координаты в кавычках
player.SetPosition(selected_spawnpoint);


У меня, вот так, прекрасно все работает. Специально зашел проверил. Просто не спеши и делай внимательно.

 

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


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

У меня вот так все заработало:



class StartSetsPlayersConfig
{
	
	
	void StartSetsPlayer(PlayerBase player,int use_set_id)
	{
		

		
		
		EntityAI itemCreated = NULL;
		EntityAI itemCreated1 = NULL;
		ItemBase itemCasted = NULL;
		EntityAI itemClothing;
		EntityAI itemEnt;
		EntityAI itemBs;
		float rand;
		
		switch( use_set_id ) //Раздаем лут (можно использовать значения от 1 и выше, только не 0 и не -1)
		{
			case 1: //Set with number 1 (Сет с номером 1)
			{
				RemoveAllItems(player); 												// Чтобы удалить с персонажа уже имеющиеся стандартные стартовые шмотки раскомментировать строку
				itemCreated = player.GetInventory().CreateInInventory("FS_HuntBag_co"); 	        // Выдаем рюкзак и записываем в переменную itemCreated
				if (itemCreated)															            
					{
						itemCreated.GetInventory().CreateInInventory("Battery9v");
						itemCreated1 = itemCreated.GetInventory().CreateInInventory("Battery9v");
						if (itemCreated1)
						{
							player.SetQuickBarEntityShortcut(itemCreated1, 4);
						}

					}
				itemCreated = NULL;
				itemCreated1 = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("DSS_Starosta");            	    // Выдаем игроку маску
			    itemCreated = player.GetInventory().CreateInInventory("FS_ForestOldCap");		        // Выдаем игроку перчатки
				itemCreated = player.GetInventory().CreateInInventory("XS_EQP_PANTS_Ironsightpants_naf");		    // Выдаем игроку штаны
				itemCreated = player.GetInventory().CreateInInventory("SFP_SurvScav_Tors");	            // Выдаем игроку обувь
				itemCreated = player.GetInventory().CreateInInventory("RusFlex_BeltUnloading_BAG");	        // Выдаем игроку куртку				
				itemCreated = player.GetInventory().CreateInInventory("RusFlex_MaskaFace_olive"); 	            // Выдаем броню
				itemCreated = player.GetInventory().CreateInInventory("Headtorch_Grey"); 	                // Выдаем ремень
				itemCreated = player.GetInventory().CreateInInventory("WoolGlovesFingerless_Green");
				itemCreated = player.GetInventory().CreateInInventory("XS_EQP_SHOES_wolverineBoots");				
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");	            // Выдаем игроку магазины к AKM в любой свободный слот в инвентаре
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("SFP_ArmyRadio169");
				itemCreated = player.GetInventory().CreateInInventory("SFP_CantenUssr");
				itemCreated = player.GetInventory().CreateInInventory("Justice_HuntingKnife");
				itemCreated = NULL;					
				
				itemCreated = player.GetInventory().CreateInInventory("St_W_BenelliM4");
				if (itemCreated)															            // Проверяем, создался ли ремень. Если он создался, переменная itemCreated будет не пуста и проверка пройдет
				{  	itemCreated.GetInventory().CreateAttachment( "St_O_Holosight" ); 				        // Выдаем игроку на AKM оптику ПСО 11 и крепим
					itemCreated.GetInventory().CreateAttachment( "anpeq_black" ); 			        // Выдаем игроку на AKM цевье, приклад и глушитель, и крепим
					itemCreated.GetInventory().CreateAttachment( "St_M_Salvo12_Suppressor" );
					itemCreated.GetInventory().CreateAttachment( "St_M_Salvo12_Suppressor" );					// Выдаем игроку на AKM цевье, приклад и глушитель, и крепим
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
				}
				itemCreated = NULL;
				itemCreated1 = NULL;
				//itemCasted = ItemBase.Cast(itemCreated);									            // Строка не нужна, закоментирована. используется для изменения класса EntityAI в ItemBase (чтобы нужные операции были доступны)

				
				
				itemCreated = player.GetInventory().CreateInInventory("PersonalRadio");
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 6);
					itemCreated.GetInventory().CreateInInventory( "Battery9V" );
				}
				itemCreated = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("FieldShovel");
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 5);
				}
				itemCreated = NULL;
				break;
			}
			
			case 2: //Set with number 2 (Сет с номером 2)
			{
				RemoveAllItems(player); 												// Чтобы удалить с персонажа уже имеющиеся стандартные стартовые шмотки раскомментировать строку
				itemCreated = player.GetInventory().CreateInInventory("AssaultBag_Ttsko"); 	        // Выдаем рюкзак и записываем в переменную itemCreated
				itemCreated = NULL;
				itemCreated1 = NULL;				

		        itemCreated = player.GetInventory().CreateInInventory("Mich2001Helmet");            	        // Выдаем игроку головной убор
				if (itemCreated)
				{
					itemCreated1 = itemCreated.GetInventory().CreateAttachment("NVGoggles");
					if (itemCreated1)
					{  			            
						itemCreated1.GetInventory().CreateInInventory( "Battery9V" );
					}
					itemCreated1 = itemCreated.GetInventory().CreateAttachment("UniversalLight");
					if (itemCreated1)
					{  			            
						itemCreated1.GetInventory().CreateInInventory( "Battery9V" );
					}					
				}
				itemCreated = NULL;
				itemCreated1 = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("BalaclavaMask_Blackskull");            	    // Выдаем игроку маску
			    itemCreated = player.GetInventory().CreateInInventory("TacticalGloves_Green");		        // Выдаем игроку перчатки
				itemCreated = player.GetInventory().CreateInInventory("BDUPants");		    // Выдаем игроку штаны
				itemCreated = player.GetInventory().CreateInInventory("MilitaryBoots_Black");	            // Выдаем игроку обувь
				itemCreated = player.GetInventory().CreateInInventory("BDUJacket");	        // Выдаем игроку куртку							
				itemCreated = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("PlateCarrierVest_Camo"); 	            // Выдаем броню
				if (itemCreated)															            // Проверяем, создаласи ли броня. Если он создался, переменная itemCreated будет не пуста и проверка пройдет
				{                                                                                       
					itemCreated.GetInventory().CreateAttachment( "PlateCarrierHolster_Camo" ); 			    // Выдаем кобуру и крепим
					itemCreated.GetInventory().CreateAttachment( "PlateCarrierPouches_Camo" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					
				}
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("MilitaryBelt"); 	                // Выдаем ремень
				if (itemCreated)															            // Проверяем, создался ли ремень. Если он создался, переменная itemCreated будет не пуста и проверка пройдет
				{  
					itemCreated.GetInventory().CreateAttachment( "PlateCarrierHolster_Camo" ); 		        // Выдаем кобуру и крепим
					if (itemCreated)
					{
						itemCreated1 = itemCreated.GetInventory().CreateInInventory ("MKII");
						if (itemCreated1)
						{
							player.SetQuickBarEntityShortcut(itemCreated1, 2);
						}
					}
					itemCreated.GetInventory().CreateAttachment( "NylonKnifeSheath" ); 			        // Выдаем ножны и крепим
					if (itemCreated)
					{
						itemCreated1 = itemCreated.GetInventory().CreateInInventory ("CombatKnife");
						if (itemCreated1)
						{
							player.SetQuickBarEntityShortcut(itemCreated1, 3);
						}
					}
				}
				itemCreated = NULL;
				itemCreated1 = NULL;
				//itemCasted = ItemBase.Cast(itemCreated);									            // Строка не нужна, закоментирована. используется для изменения класса EntityAI в ItemBase (чтобы нужные операции были доступны)
				itemCreated = player.GetInventory().CreateInInventory("TacticalGoggles");	            // Выдаем игроку магазины к MKII
				itemCreated = player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");	            // Выдаем игроку магазины к MKII
				itemCreated = player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");	            // Выдаем игроку магазины к MKII
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");		            // Выдаем игроку магазины к AKM в любой свободный слот в инвентаре
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");		            // Выдаем игроку магазины к AKM в любой свободный слот в инвентаре
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");				// Выдаем игроку магазины к AKM в любой свободный слот в инвентаре		
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");

				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");

				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");

				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_22_50Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_22_50Rnd");
				
				itemCreated = NULL;

				itemCreated = player.GetInventory().CreateInInventory("SVD");
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 1);
					itemCreated.GetInventory().CreateAttachment( "AK_Suppressor" );
					itemCreated.GetInventory().CreateAttachment( "PSO1Optic" );
					if (itemCreated)
					{  			            
						itemCreated.GetInventory().CreateInInventory( "Battery9V" );
					} 			           
				}						
							
				itemCreated = NULL;															            // Обнуляем значение переменной после работы с ней, нужно если мы будем использовать ее далее
				itemCreated = player.GetHumanInventory().CreateInHands("VSS");				            // Выдаем игроку AKM в руки
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 0);
					itemCreated.GetInventory().CreateAttachment( "PSO11Optic" );
					if (itemCreated)
					{  			            
						itemCreated.GetInventory().CreateInInventory( "Battery9V" );
					} 			           
				}
				
				itemCreated = NULL;
				itemCreated1 = NULL;
				
				player.GetStatWater().Set(5000);
				player.GetStatEnergy().Set(19000);

					
				break;
			}
			
			case 3: //Set with number 3   (Сет с номером 3)
			{
				break;
			}
			
			case 4: //Set with number 4   (Сет с номером 4)
			{
				break;
			}
			
			case 5: //Set with number 5   (Сет с номером 5)
			{
				break;
			}
			
			case 6: //Set with number 6   (Сет с номером 6)
			{
				break;
			}
			
			default: //Default starting spawn set (Сет поумолчанию для всех игроков, если хотите назначить - добавляйте здесь!)
			{
				//My_Custom_Spawn_Parameters.RemoveAllItems(player); // Чтобы удалить с персонажа уже имеющиеся стандартные стартовые шмотки раскомментировать строку
				DefaultSets(player); // Для выдачи своих сетов по рандому всем игрокам, не прописанным в скрипте, раскомментировать эту строку
				RemoveAllItems(player); 
				itemCreated = NULL;															
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Boots");	                // Выдаем игроку обувь
				itemCreated = NULL;															
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Pants");		        // Выдаем игроку Щтаны
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Sweeter");		        // Выдаем игроку свитер
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Roadflare");	                    // Выдаем игроку фальшфеер в любой свободный слот в инвентаре
				itemCreated = NULL;															            // Обнуляем значение переменной											
				itemCreated = player.GetInventory().CreateInInventory("XS_FOOD_CANNED_bstew");	                    // Выдаем игроку банку тушенки
				itemCreated = NULL;	
				itemCreated = player.GetInventory().CreateInInventory("SodaCan_cola");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("CombatKnife");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Sawedoffizh18Shotgun");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = NULL;
				
				private array <vector>  spawnpoints = {"4967.792969 104.242012 329.622406"};
				private vector selected_spawnpoint = spawnpoints.GetRandomElement();
				player.SetPosition(selected_spawnpoint);
				
				
				break;
			}
		}
	}
	
	void SetRandomHealthItem(EntityAI itemCreated) // Функция генерирует и применяет для предмета рандомное значение здоровья!
	{
		if ( itemCreated )
		{
			private int rndHlt = Math.RandomInt(55,6);
			itemCreated.SetHealth("","",rndHlt);
		}
	}
	
	void DefaultSets(PlayerBase player) // Функция выдает сеты игрокам, не прописанным в конфигурации скрипта!!!
	{
		EntityAI itemCreated = NULL;
		EntityAI itemCreated1 = NULL;
		ItemBase itemCasted = NULL;
		
				private array <vector>  spawnpoints = {"4967.792969 104.242012 329.622406"};
				private vector selected_spawnpoint = spawnpoints.GetRandomElement();
				player.SetPosition(selected_spawnpoint);
		
		
	}
	void RemoveAllItems(PlayerBase player)
    {
        array<EntityAI> itemsArray = new array<EntityAI>;
        ItemBase item;
        player.GetInventory().EnumerateInventory(InventoryTraversalType.PREORDER, itemsArray);
        
        for (int i = 0; i < itemsArray.Count(); i++)
        {
            Class.CastTo(item, itemsArray.Get(i));
            if (item && !item.IsInherited(SurvivorBase))
            {
                InventoryLocation il = new InventoryLocation();
                if (item && item.GetInventory().GetCurrentInventoryLocation(il))
                {
                    player.GetInventory().LocalDestroyEntity(item);
                }
            }
        }
    }
}

Спасибо огромное за помощь. + в карму.

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


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

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

 

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


Ссылка на сообщение
Поделиться на других сайтах
  • 0
41 минуту назад, meltraid сказал:

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

 

Дефолт надо прописывать в init.c. 

Пока решения я не нашел. Может укого-то будет время и желание, этим заняться.

 

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


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

Вот мой код с Sets.c и default работает



class StartSetsPlayersConfig
{
	
	
	void StartSetsPlayer(PlayerBase player,int use_set_id)
	{
		

		
		
		EntityAI itemCreated = NULL;
		EntityAI itemCreated1 = NULL;
		ItemBase itemCasted = NULL;
		EntityAI itemClothing;
		EntityAI itemEnt;
		EntityAI itemBs;
		float rand;
		
		switch( use_set_id ) //Раздаем лут (можно использовать значения от 1 и выше, только не 0 и не -1)
		{
			case 1: //Set with number 1 (Сет с номером 1)
			{
				RemoveAllItems(player); 												// Чтобы удалить с персонажа уже имеющиеся стандартные стартовые шмотки раскомментировать строку
				itemCreated = player.GetInventory().CreateInInventory("FS_HuntBag_co"); 	        // Выдаем рюкзак и записываем в переменную itemCreated
				if (itemCreated)															            
					{
						itemCreated.GetInventory().CreateInInventory("Battery9v");
						itemCreated1 = itemCreated.GetInventory().CreateInInventory("Battery9v");
						if (itemCreated1)
						{
							player.SetQuickBarEntityShortcut(itemCreated1, 4);
						}

					}
				itemCreated = NULL;
				itemCreated1 = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("DSS_Starosta");            	    // Выдаем игроку маску
			    itemCreated = player.GetInventory().CreateInInventory("FS_ForestOldCap");		        // Выдаем игроку перчатки
				itemCreated = player.GetInventory().CreateInInventory("XS_EQP_PANTS_Ironsightpants_naf");		    // Выдаем игроку штаны
				itemCreated = player.GetInventory().CreateInInventory("SFP_SurvScav_Tors");	            // Выдаем игроку обувь
				itemCreated = player.GetInventory().CreateInInventory("RusFlex_BeltUnloading_BAG");	        // Выдаем игроку куртку				
				itemCreated = player.GetInventory().CreateInInventory("RusFlex_MaskaFace_olive"); 	            // Выдаем броню
				itemCreated = player.GetInventory().CreateInInventory("Headtorch_Grey"); 	                // Выдаем ремень
				itemCreated = player.GetInventory().CreateInInventory("WoolGlovesFingerless_Green");
				itemCreated = player.GetInventory().CreateInInventory("XS_EQP_SHOES_wolverineBoots");				
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");	            // Выдаем игроку магазины к AKM в любой свободный слот в инвентаре
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = player.GetInventory().CreateInInventory("SFP_ArmyRadio169");
				itemCreated = player.GetInventory().CreateInInventory("SFP_CantenUssr");
				itemCreated = player.GetInventory().CreateInInventory("Justice_HuntingKnife");
				itemCreated = NULL;					
				
				itemCreated = player.GetInventory().CreateInInventory("St_W_BenelliM4");
				if (itemCreated)															            // Проверяем, создался ли ремень. Если он создался, переменная itemCreated будет не пуста и проверка пройдет
				{  	itemCreated.GetInventory().CreateAttachment( "St_O_Holosight" ); 				        // Выдаем игроку на AKM оптику ПСО 11 и крепим
					itemCreated.GetInventory().CreateAttachment( "anpeq_black" ); 			        // Выдаем игроку на AKM цевье, приклад и глушитель, и крепим
					itemCreated.GetInventory().CreateAttachment( "St_M_Salvo12_Suppressor" );
					itemCreated.GetInventory().CreateAttachment( "St_M_Salvo12_Suppressor" );					// Выдаем игроку на AKM цевье, приклад и глушитель, и крепим
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
					itemCreated.GetInventory().CreateAttachment( "Battery9v" );	
				}
				itemCreated = NULL;
				itemCreated1 = NULL;
				//itemCasted = ItemBase.Cast(itemCreated);									            // Строка не нужна, закоментирована. используется для изменения класса EntityAI в ItemBase (чтобы нужные операции были доступны)

				
				
				itemCreated = player.GetInventory().CreateInInventory("PersonalRadio");
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 6);
					itemCreated.GetInventory().CreateInInventory( "Battery9V" );
				}
				itemCreated = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("FieldShovel");
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 5);
				}
				itemCreated = NULL;
				break;
			}
			
			case 2: //Set with number 2 (Сет с номером 2)
			{
				RemoveAllItems(player); 												// Чтобы удалить с персонажа уже имеющиеся стандартные стартовые шмотки раскомментировать строку
				itemCreated = player.GetInventory().CreateInInventory("AssaultBag_Ttsko"); 	        // Выдаем рюкзак и записываем в переменную itemCreated
				itemCreated = NULL;
				itemCreated1 = NULL;				

		        itemCreated = player.GetInventory().CreateInInventory("Mich2001Helmet");            	        // Выдаем игроку головной убор
				if (itemCreated)
				{
					itemCreated1 = itemCreated.GetInventory().CreateAttachment("NVGoggles");
					if (itemCreated1)
					{  			            
						itemCreated1.GetInventory().CreateInInventory( "Battery9V" );
					}
					itemCreated1 = itemCreated.GetInventory().CreateAttachment("UniversalLight");
					if (itemCreated1)
					{  			            
						itemCreated1.GetInventory().CreateInInventory( "Battery9V" );
					}					
				}
				itemCreated = NULL;
				itemCreated1 = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("BalaclavaMask_Blackskull");            	    // Выдаем игроку маску
			    itemCreated = player.GetInventory().CreateInInventory("TacticalGloves_Green");		        // Выдаем игроку перчатки
				itemCreated = player.GetInventory().CreateInInventory("BDUPants");		    // Выдаем игроку штаны
				itemCreated = player.GetInventory().CreateInInventory("MilitaryBoots_Black");	            // Выдаем игроку обувь
				itemCreated = player.GetInventory().CreateInInventory("BDUJacket");	        // Выдаем игроку куртку							
				itemCreated = NULL;
				
				itemCreated = player.GetInventory().CreateInInventory("PlateCarrierVest_Camo"); 	            // Выдаем броню
				if (itemCreated)															            // Проверяем, создаласи ли броня. Если он создался, переменная itemCreated будет не пуста и проверка пройдет
				{                                                                                       
					itemCreated.GetInventory().CreateAttachment( "PlateCarrierHolster_Camo" ); 			    // Выдаем кобуру и крепим
					itemCreated.GetInventory().CreateAttachment( "PlateCarrierPouches_Camo" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					itemCreated.GetInventory().CreateAttachment( "RGD5Grenade" ); 		        // Выдаем карманы и крепим
					
				}
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("MilitaryBelt"); 	                // Выдаем ремень
				if (itemCreated)															            // Проверяем, создался ли ремень. Если он создался, переменная itemCreated будет не пуста и проверка пройдет
				{  
					itemCreated.GetInventory().CreateAttachment( "PlateCarrierHolster_Camo" ); 		        // Выдаем кобуру и крепим
					if (itemCreated)
					{
						itemCreated1 = itemCreated.GetInventory().CreateInInventory ("MKII");
						if (itemCreated1)
						{
							player.SetQuickBarEntityShortcut(itemCreated1, 2);
						}
					}
					itemCreated.GetInventory().CreateAttachment( "NylonKnifeSheath" ); 			        // Выдаем ножны и крепим
					if (itemCreated)
					{
						itemCreated1 = itemCreated.GetInventory().CreateInInventory ("CombatKnife");
						if (itemCreated1)
						{
							player.SetQuickBarEntityShortcut(itemCreated1, 3);
						}
					}
				}
				itemCreated = NULL;
				itemCreated1 = NULL;
				//itemCasted = ItemBase.Cast(itemCreated);									            // Строка не нужна, закоментирована. используется для изменения класса EntityAI в ItemBase (чтобы нужные операции были доступны)
				itemCreated = player.GetInventory().CreateInInventory("TacticalGoggles");	            // Выдаем игроку магазины к MKII
				itemCreated = player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");	            // Выдаем игроку магазины к MKII
				itemCreated = player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");	            // Выдаем игроку магазины к MKII
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");		            // Выдаем игроку магазины к AKM в любой свободный слот в инвентаре
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");		            // Выдаем игроку магазины к AKM в любой свободный слот в инвентаре
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");				// Выдаем игроку магазины к AKM в любой свободный слот в инвентаре		
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");
				itemCreated = player.GetInventory().CreateInInventory("Mag_Vikhr_30Rnd");

				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_9x39AP_20Rnd");

				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");

				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_22_50Rnd");
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_22_50Rnd");
				
				itemCreated = NULL;

				itemCreated = player.GetInventory().CreateInInventory("SVD");
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 1);
					itemCreated.GetInventory().CreateAttachment( "AK_Suppressor" );
					itemCreated.GetInventory().CreateAttachment( "PSO1Optic" );
					if (itemCreated)
					{  			            
						itemCreated.GetInventory().CreateInInventory( "Battery9V" );
					} 			           
				}						
							
				itemCreated = NULL;															            // Обнуляем значение переменной после работы с ней, нужно если мы будем использовать ее далее
				itemCreated = player.GetHumanInventory().CreateInHands("VSS");				            // Выдаем игроку AKM в руки
				if (itemCreated)
				{
					player.SetQuickBarEntityShortcut(itemCreated, 0);
					itemCreated.GetInventory().CreateAttachment( "PSO11Optic" );
					if (itemCreated)
					{  			            
						itemCreated.GetInventory().CreateInInventory( "Battery9V" );
					} 			           
				}
				
				itemCreated = NULL;
				itemCreated1 = NULL;
				
				player.GetStatWater().Set(5000);
				player.GetStatEnergy().Set(19000);

					
				break;
			}
			
			case 3: //Set with number 3   (Сет с номером 3)
			{
				break;
			}
			
			case 4: //Set with number 4   (Сет с номером 4)
			{
				break;
			}
			
			case 5: //Set with number 5   (Сет с номером 5)
			{
				break;
			}
			
			case 6: //Set with number 6   (Сет с номером 6)
			{
				break;
			}
			
			default: //Default starting spawn set (Сет поумолчанию для всех игроков, если хотите назначить - добавляйте здесь!)
			{
				//My_Custom_Spawn_Parameters.RemoveAllItems(player); // Чтобы удалить с персонажа уже имеющиеся стандартные стартовые шмотки раскомментировать строку
				DefaultSets(player); // Для выдачи своих сетов по рандому всем игрокам, не прописанным в скрипте, раскомментировать эту строку
				RemoveAllItems(player); 
				itemCreated = NULL;															
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Boots");	                // Выдаем игроку обувь
				itemCreated = NULL;															
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Pants");		        // Выдаем игроку Щтаны
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("SFP_Stranik_Sweeter");		        // Выдаем игроку свитер
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Roadflare");	                    // Выдаем игроку фальшфеер в любой свободный слот в инвентаре
				itemCreated = NULL;															            // Обнуляем значение переменной											
				itemCreated = player.GetInventory().CreateInInventory("XS_FOOD_CANNED_bstew");	                    // Выдаем игроку банку тушенки
				itemCreated = NULL;	
				itemCreated = player.GetInventory().CreateInInventory("SodaCan_cola");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("CombatKnife");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Sawedoffizh18Shotgun");	                    // Выдаем игроку банку коллы
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Ammo_12gaPellets");
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("SFP_Makarom_Apoc");
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Mag_IJ70_8Rnd");
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("Mag_IJ70_8Rnd");
				itemCreated = NULL;
				itemCreated = player.GetInventory().CreateInInventory("AmmoBox_380_35rnd");
				
				private array <vector>  spawnpoints = {"4967.792969 104.242012 329.622406"};
				private vector selected_spawnpoint = spawnpoints.GetRandomElement();
				player.SetPosition(selected_spawnpoint);
				
				
				break;
			}
		}
	}
	
	void SetRandomHealthItem(EntityAI itemCreated) // Функция генерирует и применяет для предмета рандомное значение здоровья!
	{
		if ( itemCreated )
		{
			private int rndHlt = Math.RandomInt(55,6);
			itemCreated.SetHealth("","",rndHlt);
		}
	}
	
	void DefaultSets(PlayerBase player) // Функция выдает сеты игрокам, не прописанным в конфигурации скрипта!!!
	{
		EntityAI itemCreated = NULL;
		EntityAI itemCreated1 = NULL;
		ItemBase itemCasted = NULL;
		
				private array <vector>  spawnpoints = {"4967.792969 104.242012 329.622406"};
				private vector selected_spawnpoint = spawnpoints.GetRandomElement();
				player.SetPosition(selected_spawnpoint);
		
		
	}
	void RemoveAllItems(PlayerBase player)
    {
        array<EntityAI> itemsArray = new array<EntityAI>;
        ItemBase item;
        player.GetInventory().EnumerateInventory(InventoryTraversalType.PREORDER, itemsArray);
        
        for (int i = 0; i < itemsArray.Count(); i++)
        {
            Class.CastTo(item, itemsArray.Get(i));
            if (item && !item.IsInherited(SurvivorBase))
            {
                InventoryLocation il = new InventoryLocation();
                if (item && item.GetInventory().GetCurrentInventoryLocation(il))
                {
                    player.GetInventory().LocalDestroyEntity(item);
                }
            }
        }
    }
}

 

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


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

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

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

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

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

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

Войти

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

Войти сейчас

×
×
  • Создать...

Важная информация

Используя этот сайт, вы автоматически обязуетесь соблюдать наши Правила и Политика конфиденциальности.
Чтобы сделать этот веб-сайт лучше, мы разместили cookies на вашем устройстве. Вы можете изменить свои настройки cookies, в противном случае мы будем считать, что вы согласны с этим.

Поддержка