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
f1nch

BloodTestKit новый агент

Привет, нужна помощь в добавлении нового агента для мода по проверке заболеваний.

Добавляю свой исходник для указания на ошибки:

 

modded class ActionTestBloodSelf
{
    void ActionTestBloodSelf()
	{
		m_CallbackClass = ActionTestBloodSelfCB;
		m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
		m_FullBody = true;
		m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
		m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
	}

	override void CreateConditionComponents()
	{
		m_ConditionItem = new CCINonRuined;
		m_ConditionTarget = new CCTSelf;
	}

	override bool HasTarget()
	{
		return false;
	}

	override string GetText()
	{
		return "#test_blood";
	}

	string hpstatus ( int X )
	{
		string result;
		if (X == 0) result = "Ничего не найдено";
		if (X > 0 && X < 200) result = "Начальный этап";
		if (X >= 200 && X < 700) result = "Средняя стадия";
		if (X >= 700 && X <= 1000) result = "Поздняя стадия";
		return result;
	}

  string zvstatus ( int X )
	{
		string result;
    	if (X == 0) result = "Ничего не найдено";
		if (X > 0 && X < 100) result = "1. стадия";
		if (X >= 100 && X < 250) result = "2. стадия";
		if (X >= 250 && X < 500) result = "3. стадия";
   	 	if (X >= 500 && X < 750) result = "4. стадия";
    	if (X >= 750 && X < 990) result = "5. стадия";
		if (X >= 990 ) result = "6. стадия";
		return result;
	}

	string virustatus ( int X )
	{
		string result;
    	if (X == 0) result = "Ничего не найдено";
		if (X > 0 && X < 500) result = "Заражение";
		if (X >= 500 ) result = "Критическое число вирусов";
		return result;
	}

	override void OnFinishProgressServer( ActionData action_data )
	{
		PluginLifespan module_lifespan = PluginLifespan.Cast( GetPlugin( PluginLifespan ) );
		int blood_type = action_data.m_Player.GetStatBloodType().Get();

		module_lifespan.UpdateBloodType( action_data.m_Player, blood_type );
		module_lifespan.UpdateBloodTypeVisibility( action_data.m_Player, true );

		action_data.m_MainItem.Delete();
		action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );


		EStatLevels immunityLevel = action_data.m_Player.GetImmunityLevel();
		string immunityLevelStr;
		switch (immunityLevel)
		{
      		case EStatLevels.GREAT: immunityLevelStr = "Отличный"; break;
			case EStatLevels.HIGH: immunityLevelStr = "Высокий"; break;
			case EStatLevels.MEDIUM: immunityLevelStr = "Средний"; break;
			case EStatLevels.LOW: immunityLevelStr = "Никзий"; break;
			case EStatLevels.CRITICAL: immunityLevelStr = "Критический"; break;
		}

    	SendMessageToClient(action_data.m_Player, "Медицинский отчёт:");
		SendMessageToClient(action_data.m_Player, "Иммунитет: " + immunityLevelStr);
		SendMessageToClient(action_data.m_Player, "Пищевое отравление: " + action_data.m_Player.GetSingleAgentCount(eAgents.FOOD_POISON).ToString());
		SendMessageToClient(action_data.m_Player, "Холера: " + hpstatus(action_data.m_Player.GetSingleAgentCount(eAgents.CHOLERA)));
		SendMessageToClient(action_data.m_Player, "Гриппп: " + hpstatus(action_data.m_Player.GetSingleAgentCount(eAgents.INFLUENZA)));
		SendMessageToClient(action_data.m_Player, "Сальмонелла: " + hpstatus(action_data.m_Player.GetSingleAgentCount(eAgents.SALMONELLA)));
		SendMessageToClient(action_data.m_Player, "Заражение крови: " + hpstatus(action_data.m_Player.GetSingleAgentCount(eAgents.WOUND_AGENT)));
		SendMessageToClient(action_data.m_Player, "Химическое отравление: " + hpstatus(action_data.m_Player.GetSingleAgentCount(eAgents.CHEMICAL_POISON)));
		SendMessageToClient(action_data.m_Player, "Токсическое отравление: " + hpstatus(action_data.m_Player.GetSingleAgentCount(ToxicAgents.TOXICSICKNESS))); //Это и естть тот самый проблемный агент

		#ifdef ZenVirus
    	SendMessageToClient(action_data.m_Player, "Зомби Вирус: " + zvstatus(action_data.m_Player.GetSingleAgentCount(VirusAgents.VIRUS)));
		#endif
		#ifdef VIRUS
		SendMessageToClient(action_data.m_Player, "Вирус: " + virustatus(action_data.m_Player.GetSingleAgentCount(RageAgents.RAGEVIRUS)));
		#endif
		
		action_data.m_MainItem.AddHealth("", "", -4);

		if (action_data.m_MainItem.GetHealth("GlobalHealth", "Health") < 1)
        {
        action_data.m_MainItem.Delete();
        }
	}
}

        SendMessageToClient(action_data.m_Player, "Токсическое отравление: " + hpstatus(action_data.m_Player.GetSingleAgentCount(ToxicAgents.TOXICSICKNESS))); //Это и естть тот самый проблемный агент
 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

агент из ToxicZone by Dmitri если что, может у кого-то есть уже готовые решения

 

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.