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  
danisimus

Жажда и голод

1 answer to this question

Recommended Posts

  • 0

@danisimus жажда и голод настраивается в config.cpp
 

class CfgPlayer 
{
	// В минутах - время, необходимое для снижения с 100 до 0 при бездействии
	hungerDecay = 90;          // Убывание голода
	thirstDecay = 90;          // Убывание жажды
	
	// Урон в секунду при показателе 0 (здоровье/жажда)
    healthDecay = 5.0;         // Урон здоровью
	
    // Пороговые значения для восстановления (если ОБА показателя выше)
    thirstRegen = 90;          // Порог жажды для регенерации
    hungerRegen = 90;          // Порог голода для регенерации
	
    // Процент восстановления здоровья в минуту при выполнении условий
    recoveryPerMinute = 2;
	
    // Коэффициент точности прицеливания (влияет на колебание оружия)
    // https://community.bistudio.com/wiki/Arma_3_Stamina
    // Значение -1 для использования стандартных настроек Arma 3
    customAimCoefficient = 0.5;  // Пользовательский коэффициент прицеливания
	
    // Включение/выключение систем усталости (0-выкл, 1-вкл)
    enableFatigue = 0;          // Усталость
    enableStamina = 0;          // Выносливость

    // Отключение рисования карты (1-отключено, 0-включено)
    disableMapDrawing = 1;

    // Использование рельефа местности при автобеге
    // 0 - стандартный автобег Exile
    useGradientAffectedAutoRun = 0;
};

hungerDecay = 140;
thirstDecay = 120;
Можно и так ещё изменить.

А на трейде, есть скрипт ExileClient_object_player_stats_update.sqf - подключать в CfgExileCustomCode

/**
 * ExileClient_object_player_stats_update
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_timeElapsed", "_hungerFactor", "_thirstFactor", "_bloodAlcohol", "_effectAttribute", "_effectValue", "_effectDuration", "_effectStartTime", "_effectValueRemaining", "_endEffect", "_effectToApply", "_hunger", "_thirst"];
if (isNil "ExileLastStatUpdate") then 
{ 
	ExileLastStatUpdate = diag_tickTime; 
};
_timeElapsed = diag_tickTime - ExileLastStatUpdate;
if (diag_tickTime - ExileClientLastTemperatureUpdateAt >= 5) then
{
	(diag_tickTime - ExileClientLastTemperatureUpdateAt) call ExileClient_object_player_stats_updateTemperature;
	ExileClientLastTemperatureUpdateAt = diag_tickTime;
};
ExileClientPlayerLoad = loadAbs player;
ExileClientPlayerOxygen = getOxygenRemaining player * 100;
ExileClientPlayerAttributes set [0, (1 - damage player) * 100];
ExileClientPlayerAttributes set [1, (1 - getFatigue player) * 100];
ExileClientPlayerIsAbleToBreathe = isAbleToBreathe player;
ExileClientPlayerIsInfantry = (vehicle player) isEqualTo player;
ExileClientPlayerVelocity = player call BIS_fnc_absSpeed;
ExileClientPlayerIsBleeding = isBleeding player;
ExileClientPlayerIsBurning = isBurning player;
ExileClientPlayerIsOverburdened = ExileClientPlayerLoad > 900; 
ExileClientPlayerIsDrowning = ExileClientPlayerOxygen < 50;
ExileClientPlayerIsInjured = (ExileClientPlayerAttributes select 0) < 50;
ExileClientPlayerIsHungry = (ExileClientPlayerAttributes select 2) < 25;
ExileClientPlayerIsThirsty = (ExileClientPlayerAttributes select 3) < 25;
ExileClientPlayerIsExhausted = (ExileClientPlayerAttributes select 1) < 40;
ExileClientPlayerIsHungry call ExileClient_gui_hud_toggleHungerIcon;
ExileClientPlayerIsThirsty call ExileClient_gui_hud_toggleThirstIcon;
if (ExileClientIsAutoRunning) then
{
	call ExileClient_system_autoRun_update;
};
if (ExileClientPlayerIsInCombat) then
{
	if( diag_tickTime - ExileClientPlayerLastCombatAt >= 30 ) then
	{
		ExileClientPlayerIsInCombat = false;
		false call ExileClient_gui_hud_toggleCombatIcon;
		call ExileClient_system_rating_balance;		
	};
};
_hungerFactor = 1;
_thirstFactor = 1;
if (ExileClientPlayerIsInfantry) then
{
	//Исправление проблемы с подглядыванием под пол. Начало.
	/*if (getPosATL player select 2 > 0.4) then//проверьте, находится ли игрок на высоте более 0,4 м над землей, чтобы не проверять слишком много
	{
		if(animationState player != client_currentAnimation) then
		{
			private _old = client_currentAnimation;
			client_currentAnimation = animationState player;
			if(client_currentAnimation in client_toLowKneelAnimations && player weaponDirection "" select 2 < -0.86) exitWith
			{
				player playMoveNow _old;
				cameraOn switchCamera "EXTERNAL";
				["ErrorTitleOnly", ["Не подглядывать за полом!"]] spawn ExileClient_gui_toaster_addTemplateToast; 
			};
			client_inLowKneel = client_currentAnimation in client_lowKneelAnimations;
		};
		if(client_inLowKneel) then
		{
			if(player weaponDirection "" select 2 < -0.86) then
			{
				client_inLowKneel = false;
				cameraOn switchCamera "EXTERNAL";
				player playAction "AdjustF";
				["ErrorTitleOnly", ["Не подглядывать за полом!"]] spawn ExileClient_gui_toaster_addTemplateToast; 
			};
		};
	};*/
	//Конец исправления проблемы с выглядыванием из-под пола.
	ExileClientPlayerVelocity = ExileClientPlayerVelocity min 24;
	if (ExileClientPlayerVelocity > 0) then 
	{
		_hungerFactor = 1 + ExileClientPlayerVelocity / 64 * _timeElapsed; 
		_thirstFactor = 1 + ExileClientPlayerVelocity / 48 * _timeElapsed; 
	};
}
else 
{
	if (ExileClientIsInBush) then 
	{
		call ExileClient_object_bush_detach;
	};
	if (ExileClientPlayerIsBambi) then 
	{
		if !((typeOf (vehicle player)) isEqualTo "Steerable_Parachute_F") then
		{
			call ExileClient_object_player_bambiStateEnd;
		};
	};
};
if (getText(missionConfigFile >> "Header" >> "gameMode") isEqualTo "Escape") then 
{
	ExileClientPlayerAttributes set [2, 100];
	ExileClientPlayerAttributes set [3, 100];
}
else
{
	ExileClientPlayerAttributes set [2, ((((ExileClientPlayerAttributes select 2) - (100 / ExileClientHungerDecay * _hungerFactor * _timeElapsed)) min 100) max 0)];
	ExileClientPlayerAttributes set [3, ((((ExileClientPlayerAttributes select 3) - (100 / ExileClientThirstDecay * _thirstFactor * _timeElapsed)) min 100) max 0)];
};
if ((ExileClientPlayerAttributes select 2) == 0 || (ExileClientPlayerAttributes select 3) == 0 || ExileClientPlayerIsBleeding) then
{
	ExileClientPlayerAttributes set [0, ((((ExileClientPlayerAttributes select 0) - ExileClientHealthDecay * _timeElapsed) min 100) max 0)];
};
_bloodAlcohol = (ExileClientPlayerAttributes select 4);
if (_bloodAlcohol > 0) then
{
	ExileClientPlayerAttributes set [1, linearConversion [0, 3, _bloodAlcohol, 100, 0, true]];
};
{
	_effectAttribute = _x select 0;
	_effectValue = _x select 1;
	_effectDuration = _x select 2;
	_effectStartTime = _x select 3;
	_effectValueRemaining = _x select 4;
	_endEffect = time - _effectStartTime >= _effectDuration; 
	if( _effectValue > 0 ) then 
	{
		if (_effectDuration == 0) then 
		{
			_effectToApply = _effectValue;
		}
		else 
		{
			_effectToApply = (_effectValue / _effectDuration * _timeElapsed) min _effectValueRemaining;
		};
		_x set [4, _effectValueRemaining - _effectToApply];
		ExileClientPlayerAttributes set [_effectAttribute, ((((ExileClientPlayerAttributes select _effectAttribute) + _effectToApply) min 100) max 0)];
	}
	else 
	{
		if (_effectDuration == 0) then 
		{
			_effectToApply = abs _effectValue;
		}
		else 
		{
			_effectToApply = ((abs _effectValue) / _effectDuration * _timeElapsed) max _effectValueRemaining;
		};
		_x set [4, _effectValueRemaining + _effectToApply];
		ExileClientPlayerAttributes set [_effectAttribute, (((ExileClientPlayerAttributes select _effectAttribute) - (abs _effectToApply) min 100) max 0)];
	};
	if( (ExileClientPlayerAttributes select _effectAttribute) == 0 || (ExileClientPlayerAttributes select _effectAttribute) == 100 ) then
	{
		_endEffect = true;
	};
	if( _endEffect ) then
	{
		ExileClientPlayerEffects deleteAt _forEachIndex;
	};
}
 foreach ExileClientPlayerEffects;
player setDamage (1 - (ExileClientPlayerAttributes select 0) / 100);
_hunger = ExileClientPlayerAttributes select 2;
_thirst = ExileClientPlayerAttributes select 3;
if (diag_tickTime - ExileClientPlayerLastHpRegenerationAt >= 60) then
{
	if (_hunger >= ExileClientHungerRegen) then
	{
		if (_thirst >= ExileClientThirstRegen) then
		{
			player setDamage (((damage player) - ExileClientRecoveryAmmount) max 0);
			ExileClientPlayerLastHpRegenerationAt = diag_tickTime;
		};	
	};
};
if ("Exile_Headgear_GasMask" in (assignedItems player)) then 
{
	if !(ExileClientGasMaskVisible) then 
	{
		true call ExileClient_gui_gasMask_toggle;
	};
	if (alive player) then 
	{
		if (diag_tickTime >= ExileGasMaskNextSoundAt) then 
		{
			playSound format ["Exile_Sound_GasMaskBreathing0%1", 1 + (floor (random 2))];
			ExileGasMaskNextSoundAt = diag_tickTime + (2.2 + (random 1));
		};
	};
}
else 
{
	if (ExileClientGasMaskVisible) then 
	{
		false call ExileClient_gui_gasMask_toggle;
	};
};
ExileLastStatUpdate = diag_tickTime;
true

Вот это часть кода отключать смерть от голода и жажды в трейде зоне (было раньше так)
 

{
	if (_hunger >= ExileClientHungerRegen) then
	{
		if (_thirst >= ExileClientThirstRegen) then
		{
			player setDamage (((damage player) - ExileClientRecoveryAmmount) max 0);
			ExileClientPlayerLastHpRegenerationAt = diag_tickTime;
		};	
	};
};

 

Share this post


Link to post
Share on other sites
MagicByte MagicByte MagicByte

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.

Поддержка