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
Sign in to follow this  
Verum

Зона и фильтр

Ребят, подскажите пожалуйста...
Прописал скрипт, что если игрок входит в зону, то идёт проверка на наличие фильтра и противогаза. Всё работает, фильтра расходуются. Но, когда он заканчивается нет урона персонажу. Т.е. пока даже пустой фильтр в слоте, урона нет. Как прописать, что бы при Quantity =0, начинал идти урон.

 

Вопрос снят.
 

 

Edited by Verum (see edit history)

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

попробуй проверку повторять по таймеру, а по урону Саша 123 точно знает как сделать

Edited by C0BA (see edit history)

Share this post


Link to post
Share on other sites



  • 0
5 часов назад, Verum сказал:

Вопрос снят.

КАК решил вопрос...или как обычно-"бла-бла" помогите, решение-фиг вам?

Share this post


Link to post
Share on other sites
  • 0

@paranoyk 
Ну перегибать то не надо.. всегда пишу если сам, или выделаю чей-то ответ.. может 1 раз с телефона отвечал, и забыл про это, когда домой пришёл...

А вообще, вот:
 

private bool Inzone1(PlayerBase player1, ref Zone zone_1) 
	{
		vector player_position1 = player1.GetPosition();
		player_position1[1] = 0;
		
		if( (vector.Distance(player_position1, zone_1.pos)) < zone_1.radius ) 
		{
			
			private EntityAI attachment;
			private ItemBase item;
			private string className;
			private float safe = 0;
			
			attachment = player1.FindAttachmentBySlotName("Mask");
			if ( attachment && attachment.IsItemBase() ) 
			{
				item		=	Class.Cast(attachment);
				className	=	item.GetType();
				if ( className.Contains("AirborneMask") ) 
				{
					safe = safe + 1.0;
					if (attachment.GetHealth() <= 0)
					{
						safe = safe - 1.0;
					}
				}
			}

			attachment = item.FindAttachmentBySlotName("AirborneMaskFilter");
			if ( attachment && attachment.IsItemBase() ) 
			{
				item		=	Class.Cast(attachment);
				className	=	item.GetType();
				if ( className.Contains("AirborneMask_Filter") ) 
				{
					safe = safe + 1.0;
				}
				if (attachment.GetQuantity() <= 0)
				{
					safe = safe - 1.0;
				}
			}
			
			if ( safe > 1.0 && !inzone_1 && !attachment.IsRuined() )
			{
				private float damage_player;
				private float damage_zone = 1.0;
				
				attachment = player1.FindAttachmentBySlotName("Mask");
				if ( attachment && attachment.IsItemBase() )
				{
					item		=	Class.Cast(attachment);
					className	=	item.GetType();
					if ( className.Contains("AirborneMask") )
					{
					item.SetHealth("","",item.GetHealth() - 0.46);
					}
				}
				
				attachment = player1.FindAttachmentBySlotName("Mask");
				if ( attachment && attachment.IsItemBase() )
				{
					item		=	Class.Cast(attachment);
					className	=	item.GetType();
					if ( className.Contains("GP5GasMask") )
					{
					item.SetHealth("","",item.GetHealth() - 0.46);
					}
				}

				inzone_1 = true;
				
			return true;
			}
			player1.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_COUGH);
			damage_player = player1.GetHealth("GlobalHealth", "Health");
			player1.SetHealth("GlobalHealth", "Health", damage_player - 10);
			Param1<string> m_MessageParam = new Param1<string>("Меня что-то убивает... Нужен защитный костюм.");
			GetGame().RPCSingleParam(player1, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player1.GetIdentity());
			//player1.InsertAgent(MedicalAttentionAgents.UNKNOWN_TOXINE, 50);

			return true;
		}
		
		return false;
	}

Добавил
if (attachment.GetQuantity() <= 0)

Share this post


Link to post
Share on other sites
  • 0

Тут вопрос в другом встал..
Пример: у всех элементов химкостюма здоровья 100. Урон стоит у всех одинаков 0,37.
Прошло 23 минуты. 
Казалось бы, но всё должно руинится одинаково, но ботинки почему то руинятся горАААздо быстрее..
Кто знает, в чём может быть причина?

Share this post


Link to post
Share on other sites
  • 0

@AKuznecov 
Вот пример.
Куртка: 
 

class NBCJacketGray: NBCJacketBase
	{
		class DamageSystem
		{
			class GlobalHealth
			{
				class Health
				{
					hitpoints=100;
					healthLevels[]=
					{
						
						{
							1.0,
							
							{
								"DZ\characters\tops\Data\NBC_Jacket.rvmat",
								"DZ\characters\tops\Data\NBC_Jacket_g.rvmat"
							}
						},
						
						{
							0.7,
							
							{
								"DZ\characters\tops\Data\NBC_Jacket.rvmat",
								"DZ\characters\tops\Data\NBC_Jacket_g.rvmat"
							}
						},
						
						{
							0.5,
							
							{
								"DZ\characters\tops\Data\NBC_Jacket_damage.rvmat",
								"DZ\characters\tops\Data\NBC_Jacket_g_damage.rvmat"
							}
						},
						
						{
							0.3,
							
							{
								"DZ\characters\tops\Data\NBC_Jacket_damage.rvmat",
								"DZ\characters\tops\Data\NBC_Jacket_g_damage.rvmat"
							}
						},
						
						{
							0.0,
							
							{
								"DZ\characters\tops\Data\NBC_Jacket_destruct.rvmat",
								"DZ\characters\tops\Data\NBC_Jacket_g_destruct.rvmat"
							}
						}
					};
				};
			};
		};
	};

Вот ботинки:
 

class NBCBootsGray: NBCBootsBase
	{
	class DamageSystem
		{
			class GlobalHealth
			{
				class Health
				{
					hitpoints=100;
					healthLevels[]=
					{
						
						{
							1.0,
							
							{
								"DZ\characters\shoes\Data\NBC_Boots.rvmat"
							}
						},
						
						{
							0.7,
							
							{
								"DZ\characters\shoes\Data\NBC_Boots.rvmat"
							}
						},
						
						{
							0.5,
							
							{
								"DZ\characters\shoes\Data\NBC_Boots_damage.rvmat"
							}
						},
						
						{
							0.3,
							
							{
								"DZ\characters\shoes\Data\NBC_Boots_damage.rvmat"
							}
						},
						
						{
							0.0,
							
							{
								"DZ\characters\shoes\Data\NBC_Boots_destruct.rvmat"
							}
						}
					};
				};
			};
		};
	};

Урон стоит один. Время входа в зону (не бежал, тепнулся, поэтому износа быть не могло) одно, ботинки условно руинятся за 15 минут, куртка за 21

Share this post


Link to post
Share on other sites
  • 0

Всё, разобрался.. не увидел, что для ботинок 2 раза урон прописан..классовое имя не изменил..(их три вида там).

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
Sign in to follow this  

×
×
  • 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.