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
Temko

Дебаг монитор.

Всем добрейший вечерочек.

 

Хотел бы спросить, возможно ли такое реализовать в дебаге: если у тебя хуманити больше -5000, то хумка на дебаге отображалась бы красным цветом, а если хумка +5000, то она бы отображалась синим. Если возможно, опишите пожалуйста как это сделать.

Share this post


Link to post
Share on other sites

15 answers to this question

Recommended Posts

  • 0
<t size='1' font='Bitstream' align='left' color='FFBF00'>Человечность: </t><t size='1' font='Bitstream' align='right' color='%14'>%3</t><br/>

вот. держи.

Share this post


Link to post
Share on other sites



  • 0

У тебя 100500 примеров, - как сделать, - в инфистаре. там есть цветные строки. посмотри, да напиши так же.

проверку if сам догадаешся куда вставить.

Edited by NoNameUltima (see edit history)

Share this post


Link to post
Share on other sites
  • 0

Можно. 

 

Берем значение хуманити:

_humanity = player getVariable['humanity',0];

Определяем цвет для разного значения человечности:

_humColor = "";
if (_humanity <= -5000) then { _humColor =  "#ff0000"; };
if (_humanity >= 5000) then { _humColor = "#0000ff"; };

Используем переменную с цветом:

...
<t size='1.0' font='Bitstream' align='left' color='%11'>Человечность: </t><t size='1' font='Bitstream' align='right'>%10</t><br/>
...
"",
...
,_humColor

%11 - если индекс переменной 11 или, по-простому, какая она по счету.

Share this post


Link to post
Share on other sites
  • 0

Можно. 

 

Берем значение хуманити:

_humanity = player getVariable['humanity',0];

Определяем цвет для разного значения человечности:

_humColor = "";
if (_humanity <= -5000) then { _humColor =  "#ff0000"; };
if (_humanity >= 5000) then { _humColor = "#0000ff"; };

Используем переменную с цветом:

...
<t size='1.0' font='Bitstream' align='left' color='%11'>Человечность: </t><t size='1' font='Bitstream' align='right'>%10</t><br/>
...
"",
...
,_humColor

%11 - если индекс переменной 11 или, по-простому, какая она по счету.

Спасибо, именно это и искал, так как особо не разбираюсь в этом, с вашей помощью хоть чему-то научусь:) +обоим

Share this post


Link to post
Share on other sites
  • 0

Можно. 

 

Берем значение хуманити:

_humanity = player getVariable['humanity',0];

Определяем цвет для разного значения человечности:

_humColor = "";
if (_humanity <= -5000) then { _humColor =  "#ff0000"; };
if (_humanity >= 5000) then { _humColor = "#0000ff"; };

Используем переменную с цветом:

...
<t size='1.0' font='Bitstream' align='left' color='%11'>Человечность: </t><t size='1' font='Bitstream' align='right'>%10</t><br/>
...
"",
...
,_humColor

%11 - если индекс переменной 11 или, по-простому, какая она по счету.

Рано я поставил "Вопрос решён", вроде выглядит в установке легко, но столкнулся с некой трудностью)

Вообщем смотри, я взял и сделал так:

 

1) Вписал в AH.sqf, 

После этого:

						_humanity = player getVariable['humanity',0];
						if (_humanity > 999999) then
						{
							_humanity = [_humanity] call fnc_format_humanity;
							_humanity = toArray _humanity;
							_humanity = _humanity - [44];
							_humanity = toString _humanity;
						};

Это: 

						_humColor = "";
							if (_humanity <= -5000) then { _humColor =  "#ff0000"; };
							if (_humanity >= 5000) then { _humColor = "#0000ff"; };

Ну как бы добавил переменную _humColor, теперь пошел к дебагу, и в цвет человечности добавил %14, и поставил в 14 переменную _humColor,

Получилось так:

hintSilent parseText format[""
						<t size='1' font='Bitstream' align='Center' >[%1]</t><br/>
						<t size='0.8' font='Bitstream' align='Center' >Игроков на сервере: %12</t><br/>
						<img size='4.75' image='%4'/><br/>
						<t size='1' font='Bitstream' align='left' color='#CC0000'>Кровь: </t><t size='1' font='Bitstream' align='right'>%2</t><br/>
						<t size='1' font='Bitstream' align='left' color='%14'>Человечность: </t><t size='1' font='Bitstream' align='right'>%3</t><br/>
						<br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>Зомби убито: </t><t size='1' font='Bitstream' align='right'>%9</t><br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>Мародерство: </t><t size='1' font='Bitstream' align='right'>%10</t><br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>Бандитов убито: </t><t size='1' font='Bitstream' align='right'>%11</t><br/>
						<br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>%13</t><t size='1' font='Bitstream' align='right'>%5ч %6мин</t><br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='1' font='Bitstream' align='right'>%8</t><br/>
						<t size='1' font='Bitstream' align='Center' color='#CC0000'>%7</t>
						"",
						_txt,
						(r_player_blood),
						_humanity,
						_pic,
						_hours,
						_minutes2,
						_BottomDebug,
						(round diag_fps),
						(player getVariable['zombieKills', 0]),
						(player getVariable['humanKills', 0]),
						(player getVariable['banditKills', 0]),
						_pOn,
						_timertext
						_humColor
						];
						uiSleep 1;

И все, теперь при входе в игру у меня просто не работает админка в целом) Не говоря про дебаг)

Что я сделал не так? Сразу говорю, особо в этом не разбираюсь, но хочу разбираться) Можешь описать подробно, если не сложно)

Share this post


Link to post
Share on other sites
  • 0

Во-первых, начинаете с того, что смотрите логи (RPT).
Во-вторых, вы забыли запятую перед  _humColor.

Share this post


Link to post
Share on other sites
  • 0

Во-первых, начинаете с того, что смотрите логи (RPT).

Во-вторых, вы забыли запятую перед  _humColor.

Запятую поставил, но все равно, вот логи, полностью флудит от этом:

 

22:03:08 Error in expression if (_humanity >= 500>

22:03:08 Error position: <#ff0000"; };

if (_humanity >= 500>

22:03:08 Error Missing )

22:03:08 File z\addons\dayz_server\init\AH.sqf, line 4887

22:03:08 Error in expression if (_humanity >= 500>

22:03:08 Error position: <#ff0000"; };

if (_humanity >= 500>

22:03:08 Error Missing )

22:03:08 File z\addons\dayz_server\init\AH.sqf, line 4887

22:03:08 "Res3tting B!S effects..."

22:03:08 Error in expression if (_humanity >= 500>

22:03:08 Error position: <#ff0000"; };

if (_humanity >= 500>

22:03:08 Error Missing )

22:03:08 File z\addons\dayz_server\init\AH.sqf, line 4887

 

 

Не знаю что делать(

Share this post


Link to post
Share on other sites
  • 0

Код дебага выложите. 

Вот:

						hintSilent parseText format[""
						<t size='1' font='Bitstream' align='Center' >[%1]</t><br/>
						<t size='0.8' font='Bitstream' align='Center' >Игроков на сервере: %12</t><br/>
						<img size='4.75' image='%4'/><br/>
						<t size='1' font='Bitstream' align='left' color='#CC0000'>Кровь: </t><t size='1' font='Bitstream' align='right'>%2</t><br/>
						<t size='1' font='Bitstream' align='left' color='%14'>Человечность: </t><t size='1' font='Bitstream' align='right'>%3</t><br/>
						<br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>Зомби убито: </t><t size='1' font='Bitstream' align='right'>%9</t><br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>Мародерство: </t><t size='1' font='Bitstream' align='right'>%10</t><br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>Бандитов убито: </t><t size='1' font='Bitstream' align='right'>%11</t><br/>
						<br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>%13</t><t size='1' font='Bitstream' align='right'>%5ч %6мин</t><br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='1' font='Bitstream' align='right'>%8</t><br/>
						<t size='1' font='Bitstream' align='Center' color='#CC0000'>%7</t>
						"",
						_txt,
						(r_player_blood),
						_humanity,
						_pic,
						_hours,
						_minutes2,
						_BottomDebug,
						(round diag_fps),
						(player getVariable['zombieKills', 0]),
						(player getVariable['humanKills', 0]),
						(player getVariable['banditKills', 0]),
						_pOn,
						_timertext
						,_humColor
						];
						uiSleep 1;
					};

Share this post


Link to post
Share on other sites
  • 0

имеется ввиду и то что выше до него идет. вообще конкретно нужен диапазон строк от  4880 до  4890

Share this post


Link to post
Share on other sites
  • 0

имеется ввиду и то что выше до него идет. вообще конкретно нужен диапазон строк от  4880 до  4890

			fnc_debugX0 = 
			{
				if !("+str _DMS+") exitWith {};
				if (isNil 'debugMonitorX') then 
				{
					debugMonitorX = true;
					[] spawn fnc_debugX;
				}
				else
				{
					debugMonitorX = !debugMonitorX;
					hintSilent '';
					[] spawn fnc_debugX;
				};
			};	
			fnc_debugX = 
			{
				if !("+str _UIM+") then
				{
					admin_debug_run = 	false;
					_BottomDebug = 		"+str _BottomDebug+";
					while {debugMonitorX} do
					{
						_pic = (getText (configFile >> 'CfgVehicles' >> (typeOf vehicle player) >> 'picture'));
						if (player == vehicle player) then {_pic = (getText (configFile >> 'CfgWeapons' >> (currentWeapon player) >> 'picture'));
						}else{_pic = (getText (configFile >> 'CfgVehicles' >> (typeOf vehicle player) >> 'picture'));};
						
						_txt = '';
						_txt = (getText (configFile >> 'CfgVehicles' >> (typeOf vehicle player) >> 'displayName'));
						
						_stime = 	0;
						if (serverTime > 36000)then{_stime = time;}else{_stime = serverTime;};
						_hours = 	(_stime/60/60);
						_hours = 	toArray (str _hours);
						_hours resize 1;
						_hours = 	toString _hours;
						_hours = 	compile _hours;
						_hours =	 call  _hours;
						_minutes = 	floor(_stime/60);
						_minutes2 = ((_minutes - (_hours*60)) min 60) max 0;if(_minutes2 < 10) then {_minutes2 = format['0%1',_minutes2];};
						
						_pOn = [];
						{
							if (!isNull _x) then
							{
								if (getPlayerUID _x != '') then
								{
									_y = _x;
									if (isPlayer _y) then
									{
										{
											if (!((getPlayerUID _x) in _pOn) && (isPlayer _x)) then
											{
												_pOn = _pOn + [getPlayerUID _x];
											};
										} forEach (crew _y);
									};
								};
							};
						} forEach ([0,0,0] nearEntities ['AllVehicles', 10000000]);
						_pOn = count _pOn;
						
						_humanity = player getVariable['humanity',0];
						if (_humanity > 999999) then
						{
							_humanity = [_humanity] call fnc_format_humanity;
							_humanity = toArray _humanity;
							_humanity = _humanity - [44];
							_humanity = toString _humanity;
						};
						
						_humColor = "";
							if (_humanity <= -5000) then { _humColor =  "#ff0000"; };
							if (_humanity >= 5000) then { _humColor = "#0000ff"; };
						
						_timertext = 'UPTIME: ';
						if (!isNil 'infiSTAR_UPTIMER') then
						{
							_timertext = 	'Рестарт через: ';
							_stime = 		0;
							if (serverTime > 36000)then{_stime = time;}else{_stime = serverTime;};
							_upTimeLeft = infiSTAR_UPTIMER - _stime;
							if (_upTimeLeft > 0) then
							{
								_hours = 	(_upTimeLeft/60/60);
								_hours = 	toArray (str _hours);
								_hours resize 1;
								_hours = 	toString _hours;
								_hours = 	compile _hours;
								_hours = 	call  _hours;
								_minutes = 	floor(_upTimeLeft/60);
								_minutes2 = ((_minutes - (_hours*60)) min 60) max 0;if(_minutes2 < 10) then {_minutes2 = format['0%1',_minutes2];};
							}
							else
							{
								_hours = 	'0';
								_minutes2 = '00';
							};
						};
						
						
						hintSilent parseText format[""
						<t size='1' font='Bitstream' align='Center' >[%1]</t><br/>
						<t size='0.8' font='Bitstream' align='Center' >Игроков на сервере: %12</t><br/>
						<img size='4.75' image='%4'/><br/>
						<t size='1' font='Bitstream' align='left' color='#CC0000'>Кровь: </t><t size='1' font='Bitstream' align='right'>%2</t><br/>
						<t size='1' font='Bitstream' align='left' color='%14'>Человечность: </t><t size='1' font='Bitstream' align='right'>%3</t><br/>
						<br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>Зомби убито: </t><t size='1' font='Bitstream' align='right'>%9</t><br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>Мародерство: </t><t size='1' font='Bitstream' align='right'>%10</t><br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>Бандитов убито: </t><t size='1' font='Bitstream' align='right'>%11</t><br/>
						<br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>%13</t><t size='1' font='Bitstream' align='right'>%5ч %6мин</t><br/>
						<t size='1' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='1' font='Bitstream' align='right'>%8</t><br/>
						<t size='1' font='Bitstream' align='Center' color='#CC0000'>%7</t>
						"",
						_txt,
						(r_player_blood),
						_humanity,
						_pic,
						_hours,
						_minutes2,
						_BottomDebug,
						(round diag_fps),
						(player getVariable['zombieKills', 0]),
						(player getVariable['humanKills', 0]),
						(player getVariable['banditKills', 0]),
						_pOn,
						_timertext
						,_humColor
						];
						uiSleep 1;
					};
				};
			};
			[] spawn fnc_debugX0;
		};
	};

Вот так, да?

Share this post


Link to post
Share on other sites
  • 0

хм. ошибки вроде не вижу.
попробуй сделать так:
 

_humColor = '#FFBF00';
if (_humanity <= -5000) then { _humColor = '#ff0000'; };
if (_humanity >= 5000) then { _humColor = '#0000ff'; };

 

 

Edited by RedLink (see edit history)

Share this post


Link to post
Share on other sites
  • 0

 

хм. ошибки вроде не вижу.

попробуй сделать так:

 

_humColor = '#FFBF00';
if (_humanity <= -5000) then { _humColor = '#ff0000'; };
if (_humanity >= 5000) then { _humColor = '#0000ff'; };

Да, вот так получилось, все работает, но цвет меняет именно надпись "Человечность", а я хотел чтоб цвет меняли цифры:)

Share this post


Link to post
Share on other sites
  • 0

 

<t size='1' font='Bitstream' align='left' color='FFBF00'>Человечность: </t><t size='1' font='Bitstream' align='right' color='%14'>%3</t><br/>

вот. держи.

Спасибо большое) Слушай, думаю мож гайдик запилить, как это сделать?

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

  • Similar Content

    • By Ford
      Создание скрипта можно разделить на 2 этапа: написание кода и его тестирование. Второй у меня занимает около 80% всего времени, т.к. каждый раз нужно загружать сервер и миссию.
      Есть ли более быстрый способ отлаживать код?
    • By JolyMonk
      Здравствуйте, как можно создать свой, прозрачный, hint для дебаг монитора? 
    • By Alex39
      Дебаг монитор
      Идем в корень сервера в папку SE1\serverDZ.cfg  и открываем блокнотом, и вставляем код, ну к примеру после строки BattlEye = 1;
      loginQueueMaxPlayers = 10; storageAutoFix = 1; disablePublisherBanKick = 1; updateStrategyVersion = 1; showPlayerStatus = 1; И получаем

       
      Сам дебаг вкл/выкл  showPlayerStatus = 1;
    • By OXIDE
      http://itmages.ru/image/view/5219992/be3f0914
      http://itmages.ru/image/view/5219997/f33c7d57
      1. Есть у кого такой худ, как на скрине? 
      2. Вопрос к Ультиме. Взял с RN портала себе такой дебаг монитор. Не работает строчка "онлайн" и "до рестарта осталось". Как это реализовать? 
      Код дебаг монитора:
       
      if ((isServer) || (isDedicated)) exitWith {diag_log "custom_debug:: Script tried to launch serverside where it should not be!";}; waitUntil {!isNil "dayz_animalCheck"}; [2] spawn // Specify the default state. 0=OFF 1=SMALL 2=LARGE { private ["_displayActive","_fps","_lastFpsUpdate","_logo"]; displayState = (_this select 0); _displayActive = if (displayState == 0) then { false } else { true }; _fps = round(diag_fps); _lastFpsUpdate = diag_tickTime; _logo = "custom_debug\logo_red.paa"; /*DIK*/ (findDisplay 46) displayAddEventHandler ['keyDown','if ((_this select 1) == 0xCF) then { if (displayState > 0) then { displayState = displayState - 1; } else { displayState = 2;}; };']; /*DIK*/ while {true} do { if ((diag_tickTime - _lastFpsUpdate) > 0.9) then { _fps = round(diag_fps); _lastFpsUpdate = diag_tickTime; }; sleep 0.1; switch (displayState) do { case 0: { // Display off. if (_displayActive) then {_displayActive = false; hintSilent "";}; }; case 1: { // Display small. _displayActive = true; hintSilent parseText format [" <img size='1.4' align='left' image='%1'/><br/> <t size='1' color='#EE8888' font='Zeppelin33' align='left'>Кровь: %2</t><br/> <t size='1' color='#6EF191' font='Zeppelin33' align='left'>ФПС: %3</t> ", _logo, (player getVariable ['USEC_BloodQty',r_player_blood]), _fps ]; }; case 2: { // Display large. _displayActive = true; hintSilent parseText format [" <img size='3.2' align='center' image='%1'/><br/> <br/> <t size='1' color='#6ECCF1' font='Bitstream' align='left'>Выживание: %11 Дней</t><br/> <t size='1' color='#EE8888' font='Bitstream' align='left'>Убито бандитов: %2</t><br/> <t size='1' color='#EE8888' font='Bitstream' align='left'>Убито зомби: %3</t><br/> <t size='1' color='#EE8888' font='Bitstream' align='left'>Убито героев: %4</t><br/> <t size='1' color='#EE8888' font='Bitstream' align='left'>Выстрел в голову: %12</t><br/> <t size='1' color='#00CC00' font='Bitstream' align='center'>Онлайн: %14</t><br/> <t size='1' color='#6EF191' font='Bitstream' align='left'>Репутация: %5</t><br/> <t size='1' color='#EE8888' font='Bitstream' align='left'>Кровь: %6</t><br/> <t size='1' color='#6ECCF1' font='Zeppelin33' align='left'>ФПС: %7</t><br/> <t size='1' color='#6EF191' font='Bitstream' align='left'>Осталось до рестарта: %13 Минут</t><br/> <t size='0.9' color='#EE8888' font='Zeppelin33' align='left'>[END] Свернуть</t> ", _logo, (player getVariable ['banditKills',0]), (player getVariable ['zombieKills',0]), (player getVariable ['humanKills',0]), (player getVariable ['humanity',0]), (player getVariable ['USEC_BloodQTY',r_player_blood]), _fps, (dayz_Survived), (player getVariable['headShots',0]), (240-(round(serverTime/60))), (count playableUnits) ]; }; }; }; };
    • By almalk454
      Как убрать стандартный дебаг монитор? Хочу поставить свой. 
       


      if (_dikCode == 210) then { _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf"; }; Нашел решение в dayz_spaceInterrapt.sqf...
  • Our picks

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