Question about color changing

ihatetn931

Well-Known Member
Ok, I have a debug monitor but instead of having the colors remain the same all the time I was wondering if it was possible to make like blood change color when it hits a certain limit. Something like this

Code:
if(blood <= 6000){
//change the color here
else
//default color here.
I wanna make it so blood changes to red when you hit or go below a certain limit, is this possible if so how??

Sorry i'm new to arma scripting so I used the only scripting lang. I know for an example.
 
if(blood <= 6000) then{
blootTXT = parseText format["<font color='#ff0000'>%1</font>",blood]; }
else {
blootTXT = parseText format["<font color='#f0ffff'>%1</font>",blood];};[/CODE]
 
Code:
if (isNil "custom_monitor") then {custom_monitor = true;} else {custom_monitor = !custom_monitor;};
 
while {custom_monitor} do
{
_kills = player getVariable["zombieKills",0];
_killsH = player getVariable["humanKills",0];
_killsB = player getVariable["banditKills",0];
_humanity = player getVariable["humanity",0];
_headShots = player getVariable["headShots",0];
hintSilent parseText format ["
<t size='0.80' font='Bitstream' align='center' color='#31B404'>%1 You've Survived %2 Day('s)</t><br/>
<t size='0.80'font='Bitstream'align='left'color='#FF0000'>Blood:</t><t size='0.80' font='Bitstream'align='right'color='#FF0000'>%3</t><br/>
<t size='0.80'font='Bitstream'align='left'>Humanity:</t><t size='0.80'font='Bitstream'align='right'>%4</t><br/>
<t size='0.80'font='Bitstream'align='left'>Murders:</t><t size='0.80'font='Bitstream'align='right'>%5</t><br/>
<t size='0.80'font='Bitstream'align='left'>Bandits Killed:</t><t size='0.80'font='Bitstream'align='right'>%6</t><br/>
<t size='0.80'font='Bitstream'align='left'>Zombies Killed:</t><t size='0.80'font='Bitstream'align='right'>%7</t><br/>
<t size='0.80'font='Bitstream'align='left'>Headshots:</t><t size='0.80'font='Bitstream'align='right'>%8</t><br/>
<t size='0.80'font='Bitstream'align='left' color='#FF8000'>FPS:</t><t size='0.80'font='Bitstream'align='right'color='#FF8000'>%9</t><br/>
<t size='0.80'font='Bitstream'align='left' >Zombies (alive/total):</t><t size='0.80' font='Bitstream' align='right'>%11(%10)</t><br/>
<t size='0.80' font='Bitstream' align='left' >Vehicles:</t><t size='0.80' font='Bitstream'align='right'>%12(%13)</t><br/>
<t size='0.80'font='Bitstream'align='left'>Restart In Mins.:</t><t size='0.80'font='Bitstream'align='right'>%14</t>
",dayz_playerName,
(dayz_Survived),
r_player_blood,
round _humanity,
_killsH,
_killsB,
_kills,
_headShots,
floor(diag_fps),
(count entities "zZombie_Base"),
({alive _x} count entities "zZombie_Base"),
(count([6800, 9200, 0] nearEntities [["StaticWeapon","Car","Motorcycle","Tank","Air","Ship"],25000])),
count vehicles,
(round(239-(serverTime) / 60))
];
sleep 1;
};
 
Code:
if (isNil "custom_monitor") then {custom_monitor = true;} else {custom_monitor = !custom_monitor;};
 
while {custom_monitor} do
{
_kills = player getVariable["zombieKills",0];
_killsH = player getVariable["humanKills",0];
_killsB = player getVariable["banditKills",0];
_humanity = player getVariable["humanity",0];
_headShots = player getVariable["headShots",0];
if(r_player_blood <6000) then {
_bldtxt = format["color='#FF0000'>%1",r_player_blood];
} else {
_bldtxt = format["color='#F0FFFF'>%1",r_player_blood];
};
hintSilent parseText format ["
<t size='0.80' font='Bitstream' align='center' color='#31B404'>%1 You've Survived %2 Day('s)</t><br/>
<t size='0.80'font='Bitstream'align='left'color='#FF0000'>Blood:</t><t size='0.80' font='Bitstream'align='right'%3</t><br/>
<t size='0.80'font='Bitstream'align='left'>Humanity:</t><t size='0.80'font='Bitstream'align='right'>%4</t><br/>
<t size='0.80'font='Bitstream'align='left'>Murders:</t><t size='0.80'font='Bitstream'align='right'>%5</t><br/>
<t size='0.80'font='Bitstream'align='left'>Bandits Killed:</t><t size='0.80'font='Bitstream'align='right'>%6</t><br/>
<t size='0.80'font='Bitstream'align='left'>Zombies Killed:</t><t size='0.80'font='Bitstream'align='right'>%7</t><br/>
<t size='0.80'font='Bitstream'align='left'>Headshots:</t><t size='0.80'font='Bitstream'align='right'>%8</t><br/>
<t size='0.80'font='Bitstream'align='left' color='#FF8000'>FPS:</t><t size='0.80'font='Bitstream'align='right'color='#FF8000'>%9</t><br/>
<t size='0.80'font='Bitstream'align='left' >Zombies (alive/total):</t><t size='0.80' font='Bitstream' align='right'>%11(%10)</t><br/>
<t size='0.80' font='Bitstream' align='left' >Vehicles:</t><t size='0.80' font='Bitstream'align='right'>%12(%13)</t><br/>
<t size='0.80'font='Bitstream'align='left'>Restart In Mins.:</t><t size='0.80'font='Bitstream'align='right'>%14</t>
",dayz_playerName,
(dayz_Survived),
_bldtxt,
round _humanity,
_killsH,
_killsB,
_kills,
_headShots,
floor(diag_fps),
(count entities "zZombie_Base"),
({alive _x} count entities "zZombie_Base"),
(count([6800, 9200, 0] nearEntities [["StaticWeapon","Car","Motorcycle","Tank","Air","Ship"],25000])),
count vehicles,
(round(239-(serverTime) / 60))
];
sleep 1;
};

By the way. This 'debug monitor' causes hard spam in your arma2oaserver.rpt.
To fix it try changing your code to (the following code also includes blood color change!):
Code:
if (isNil "custom_monitor") then {custom_monitor = true;} else {custom_monitor = !custom_monitor;};
 
while {custom_monitor} do
{
sleep 1;
_kills = player getVariable["zombieKills",0];
    if (isNil "_kills") then {_kills = -1;};
_killsH = player getVariable["humanKills",0];
    if (isNil "_killsH") then {_killsH = -1;};
_killsB = player getVariable["banditKills",0];
    if (isNil "_killsB") then {_killsB = -1;};
_humanity = player getVariable["humanity",0];
    if (isNil "_humanity") then {_humanity = -1;};
_headShots = player getVariable["headShots",0];
    if (isNil "_headShots") then {_headShots = -1;};
if(r_player_blood <6000) then {
_bldtxt = format["color='#FF0000'>%1",r_player_blood];
} else {
_bldtxt = format["color='#F0FFFF'>%1",r_player_blood];
};
hintSilent parseText format ["
<t size='0.80' font='Bitstream' align='center' color='#31B404'>%1 You've Survived %2 Day('s)</t><br/>
<t size='0.80'font='Bitstream'align='left'color='#FF0000'>Blood:</t><t size='0.80' font='Bitstream'align='right'%3</t><br/>
<t size='0.80'font='Bitstream'align='left'>Humanity:</t><t size='0.80'font='Bitstream'align='right'>%4</t><br/>
<t size='0.80'font='Bitstream'align='left'>Murders:</t><t size='0.80'font='Bitstream'align='right'>%5</t><br/>
<t size='0.80'font='Bitstream'align='left'>Bandits Killed:</t><t size='0.80'font='Bitstream'align='right'>%6</t><br/>
<t size='0.80'font='Bitstream'align='left'>Zombies Killed:</t><t size='0.80'font='Bitstream'align='right'>%7</t><br/>
<t size='0.80'font='Bitstream'align='left'>Headshots:</t><t size='0.80'font='Bitstream'align='right'>%8</t><br/>
<t size='0.80'font='Bitstream'align='left' color='#FF8000'>FPS:</t><t size='0.80'font='Bitstream'align='right'color='#FF8000'>%9</t><br/>
<t size='0.80'font='Bitstream'align='left' >Zombies (alive/total):</t><t size='0.80' font='Bitstream' align='right'>%11(%10)</t><br/>
<t size='0.80' font='Bitstream' align='left' >Vehicles:</t><t size='0.80' font='Bitstream'align='right'>%12(%13)</t><br/>
<t size='0.80'font='Bitstream'align='left'>Restart In Mins.:</t><t size='0.80'font='Bitstream'align='right'>%14</t>
",dayz_playerName,
(dayz_Survived),
_bldtxt,
round _humanity,
_killsH,
_killsB,
_kills,
_headShots,
floor(diag_fps),
(count entities "zZombie_Base"),
({alive _x} count entities "zZombie_Base"),
(count([6800, 9200, 0] nearEntities [["StaticWeapon","Car","Motorcycle","Tank","Air","Ship"],25000])),
count vehicles,
(round(239-(serverTime) / 60))
];
};
 
Thank you for the help, i didn't really notice any spam in my rpt file but thanks for the info, i don't check the rpt unless i have an issue on the server. To see if i have problems with scripts i've got -showscripterrors on my dayz lauc parmeter.

I see how it's done now, it's easier then i thought it would be.

Thank you again for the help.
 
I tried your code and it just put "any" where the blood number should be, I just copy and pasted it to try it.

Even added the > after 'align='right' Cause i noticed it wasn't movin the humaninty to the next line
 
I tried your code and it just put "any" where the blood number should be, I just copy and pasted it to try it.

Even added the > after 'align='right' Cause i noticed it wasn't movin the humaninty to the next line

Ill try this on my test server and give you a working version this evening.
 
Thank ya, i tried to figure out what the problem was but i couldn't quite figure it out. I think i worked a good 2 hours or so trying to figure it out till i got sick of restarting the server lol

One question, would it be possible to add the server fps to the debug?

like when you login to admin and type #monitor it shows server usage, if so what is the variable?
 
Since I wasn't able to figure out what was causing it to say just "any" this is what I came out with.

debug_zps974b8187.png
 
Back
Top