Jump to content

[RELEASE] Status Bar With Icons & Server FPS display v1.36


Darth_Rogue

Recommended Posts

Thanks, Salutesh!  I'll update the main post shortly and credit you for the update.   :)

 

BenR - yes I looked at doing that but had some issues getting it right.  I'll look into it for a future version.  Thanks for the input!

 

Np, thanks in advance for that! And keep up that awesome work!

Link to comment
Share on other sites

Instead of this:

_colourDamage = _colourDefault;
if(_damage >= 100) then{_colourDamage = _colour100;};
if((_damage >= 90) && (_damage < 100)) then {_colourDamage =  _colour90;};
if((_damage >= 80) && (_damage < 90)) then {_colourDamage =  _colour80;};
if((_damage >= 70) && (_damage < 80)) then {_colourDamage =  _colour70;};
if((_damage >= 60) && (_damage < 70)) then {_colourDamage =  _colour60;};
if((_damage >= 50) && (_damage < 60)) then {_colourDamage =  _colour50;};
if((_damage >= 40) && (_damage < 50)) then {_colourDamage =  _colour40;};
if((_damage >= 30) && (_damage < 40)) then {_colourDamage =  _colour30;};
if((_damage >= 20) && (_damage < 30)) then {_colourDamage =  _colour20;};
if((_damage >= 10) && (_damage < 20)) then {_colourDamage =  _colour10;};
if((_damage >= 1) && (_damage < 10)) then {_colourDamage =  _colour0;};
if(_damage < 1) then{_colourDamage =  _colourDead;};

This looks a bit neater

_colourDamage = _colourDefault;
switch true do {
	case (_damage >= 100) : {_colourDamage = _colour100;};
	case ((_damage >= 80) && (_damage < 100)) : {_colourDamage =  _colour80;};
	case ((_damage >= 60) && (_damage < 80)) : {_colourDamage =  _colour60;};
	case ((_damage >= 40) && (_damage < 60)) : {_colourDamage =  _colour40;};
	case ((_damage >= 20) && (_damage < 40)) : {_colourDamage =  _colour20;};
	case ((_damage >= 1) && (_damage < 20)) : {_colourDamage =  _colour0;};
	case (_damage < 1) : {_colourDamage =  _colourDead;};
};

Although there are less options in the block above that's just me saving time writing this, works the same if you change the values to the original 10% intervals instead of 20%

Link to comment
Share on other sites

 

here the small icon for toxicity, if someone needed >> toxcity.paa

 

 

variable to get the toxicity count

_toxicity = round(EPOCH_playerToxicity);

 

That class seems to be wrong, the output value is totaly random without any toxicity?!

 

All files and download link moved to Github.  Version updated to 1.1.  More changes coming soon!

 

I will send you a pull request for some ideas if its ok.

Link to comment
Share on other sites

Doesnt work for me either tryed both install intructions the one from Readme and the ones from install.txt bot times Rpt says:

 

Net Error Finished destroyed Player etc

 

 

Sorry solved the Problem ! Forgot to remove an old #inlcude Statusbar command ;)

Link to comment
Share on other sites

Instead of this:

_colourDamage = _colourDefault;
if(_damage >= 100) then{_colourDamage = _colour100;};
if((_damage >= 90) && (_damage < 100)) then {_colourDamage =  _colour90;};
if((_damage >= 80) && (_damage < 90)) then {_colourDamage =  _colour80;};
if((_damage >= 70) && (_damage < 80)) then {_colourDamage =  _colour70;};
if((_damage >= 60) && (_damage < 70)) then {_colourDamage =  _colour60;};
if((_damage >= 50) && (_damage < 60)) then {_colourDamage =  _colour50;};
if((_damage >= 40) && (_damage < 50)) then {_colourDamage =  _colour40;};
if((_damage >= 30) && (_damage < 40)) then {_colourDamage =  _colour30;};
if((_damage >= 20) && (_damage < 30)) then {_colourDamage =  _colour20;};
if((_damage >= 10) && (_damage < 20)) then {_colourDamage =  _colour10;};
if((_damage >= 1) && (_damage < 10)) then {_colourDamage =  _colour0;};
if(_damage < 1) then{_colourDamage =  _colourDead;};

This looks a bit neater

_colourDamage = _colourDefault;
switch true do {
	case (_damage >= 100) : {_colourDamage = _colour100;};
	case ((_damage >= 80) && (_damage < 100)) : {_colourDamage =  _colour80;};
	case ((_damage >= 60) && (_damage < 80)) : {_colourDamage =  _colour60;};
	case ((_damage >= 40) && (_damage < 60)) : {_colourDamage =  _colour40;};
	case ((_damage >= 20) && (_damage < 40)) : {_colourDamage =  _colour20;};
	case ((_damage >= 1) && (_damage < 20)) : {_colourDamage =  _colour0;};
	case (_damage < 1) : {_colourDamage =  _colourDead;};
};

Although there are less options in the block above that's just me saving time writing this, works the same if you change the values to the original 10% intervals instead of 20%

 

 

 

switch is slower than if then else.

 

https://community.bistudio.com/wiki/Code_Optimisation#If_Else_If_Else_If_Else_...

Link to comment
Share on other sites

 

If you only have 1 switch with 10 possible cases, then it is much better for a switch instead of 10 individual if statements. 2 or 3 ifs would probably be better than a switch with 2 or 3 cases, but anything more than 3 possible outcomes a switch would be better.

Link to comment
Share on other sites

If anyone wants to feel free to do a fork or a pull request if you want to make changes or additions with working code.  I'll review the changes and merge them as long as they are functional and make sense to the overall scope and theme of the status bar.  

 

Just keep in mind that we only have a limited amount of screen real estate to work with.  We can't possibly add everything that everyone wants in the space that we have.  My vision for this was meant to be fairly minimalist while still displaying the crucial information that players need at any given moment.  It's not meant to be all things to all people.  If that's what folks are wanting, Zupa has created a that is highly customizable on a per-user basis.  

 

There are no less than 4 variations of a status bar here on the forums, and many other resources can be found on places like OpenDayZ.  Any server owners with even minimal scripting knowledge can pick and choose things that they want to include to create their own custom version of this without having to modify the stock code for everyone. I wrote/edited this so it would be easy for people to understand and change, so please, feel free to make your own edits and post examples that other people can use.  That being said, I probably won't be merging every suggestion that people make into the stock download.  If I skip your suggestion, please don't be offended.  That simply means I don't feel that your suggestion "fits" with my vision for the stock version.  Have fun with it!  Something simple like this is perfect for people who are new to scripting to learn some basics.  

Link to comment
Share on other sites

This is probably what they're getting.

 

21:08:44 Error in expression <
 
 
 
 
 
 
 
 
 
 
if ((getPlayerUID player) in admin_list) then 
 
 
_rscLayer = "osef>
21:08:44   Error position: <admin_list) then 
 
 
_rscLayer = "osef>
21:08:44   Error Undefined variable in expression: admin_list
21:08:44 File mpmissions\__CUR_MP.Altis\fn_statusbar_with_icons.sqf, line 14
Link to comment
Share on other sites

That can be fixed by adding a line on line 13 like this

admin_list = ["xxxxxxxxxxxxx","xxxxxxxxxxxxxx"];

Replace the x with your admin id's.

Salutesh likely added that since he uses that variable with Infistar. I have a new solution for that in the works for tomorrow.

Link to comment
Share on other sites

Got it fixed Darth regarding my server not starting. You were right, I had }; missing and it works perfect now. Great job on the script by the way. Only one little niggle to mention though. When the numbers increase on the Stamina for example, the time disappears from the statusbar leaving just the pic of the clock. Any way to fix this so the time is showing constantly ?

Regards

MetalHead

Link to comment
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...