From 4aa2e8ee874c06396a3927ec8681ea4305875944 Mon Sep 17 00:00:00 2001 From: Zepheris Date: Thu, 20 Feb 2020 16:11:10 -0700 Subject: [PATCH] Changed Player variable to not subtract 1. Status bar will now show all players logged in. --- .../addons/status_bar/adminBar.sqf | 78 ++++++++-------- .../addons/status_bar/adminBar_WS.sqf | 84 ++++++++--------- .../addons/status_bar/playerBar.sqf | 90 +++++++++---------- 3 files changed, 126 insertions(+), 126 deletions(-) diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar.sqf b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar.sqf index a190f8d..1b75ae4 100644 --- a/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar.sqf +++ b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar.sqf @@ -22,22 +22,22 @@ disableSerialization; _colour10 = parseText "#CC3300"; _colour0 = parseText "#CC0000"; _colourDead = parseText "#000000"; - - - while {true} do + + + while {true} do { sleep 1; - + //moved the creation of the status bar inside the loop and create it if it is null, - //this is to handle instance where the status bar is disappearing + //this is to handle instance where the status bar is disappearing if(isNull ((uiNamespace getVariable "statusBar")displayCtrl 55555)) then { diag_log "statusbar is null create"; disableSerialization; _rscLayer = "statusBar" call BIS_fnc_rscLayer; _rscLayer cutRsc["statusBar","PLAIN"]; - }; - + }; + //initialize variables and set values _unit = _this select 0; _damage = round ((1 - (damage player)) * 100); @@ -52,13 +52,13 @@ disableSerialization; _pos = getPosATL player; //switch to this below if you want to have world space coords displayed instead of gridref _dir = getDir (vehicle player); _grid = mapGridPosition player; - _xx = (format[_grid]) select [0,3]; - _yy = (format[_grid]) select [3,3]; + _xx = (format[_grid]) select [0,3]; + _yy = (format[_grid]) select [3,3]; _time = (round(240-(serverTime)/60)); //edit the '240' value (60*4=240) to change the countdown timer if your server restarts are shorter or longer than 4 hour intervals _hours = (floor(_time/60)); _minutes = (_time - (_hours * 60)); - _players = (count playableUnits -1); - + _players = (count playableUnits); + switch(_minutes) do { case 9: {_minutes = "09"}; case 8: {_minutes = "08"}; @@ -71,11 +71,11 @@ disableSerialization; case 1: {_minutes = "01"}; case 0: {_minutes = "00"}; }; - + //Colour coding //Damage _colourDamage = _colourDefault; - + switch true do { case(_damage >= 100) : {_colourDamage = _colour100;}; case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour90;}; @@ -90,8 +90,8 @@ disableSerialization; case((_damage >= 1) && (_damage < 10)) : {_colourDamage = _colour0;}; case(_damage < 1) : {_colourDamage = _colourDead;}; }; - - + + //Hunger _colourHunger = _colourDefault; switch true do { @@ -108,9 +108,9 @@ disableSerialization; case((_hunger >= 1) && (_hunger < 10)) : {_colourHunger = _colour0;}; case(_hunger < 1) : {_colourHunger = _colourDead;}; }; - + //Thirst - _colourThirst = _colourDefault; + _colourThirst = _colourDefault; switch true do{ case(_thirst >= 100) : {_colourThirst = _colour100;}; case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour90;}; @@ -125,7 +125,7 @@ disableSerialization; case((_thirst >= 1) && (_thirst < 10)) : {_colourThirst = _colour0;}; case(_thirst < 1) : {_colourThirst = _colourDead;}; }; - + //Energy _colourEnergy = _colourDefault; switch true do{ @@ -142,7 +142,7 @@ disableSerialization; case((_energyPercent >= 1) && (_energyPercent < 10)) : {_colourEnergy = _colour0;}; case(_energyPercent < 1) : {_colourEnergy = _colour0;}; }; - + //Toxicity _colourToxicity = _colourDefault; switch true do{ @@ -159,45 +159,45 @@ disableSerialization; case((_toxPercent >= 1) && (_toxPercent < 10)) : {_colourToxicity = _colour90;}; case(_toxPercent < 1) : {_colourToxicity = _colour100;}; }; - + //Stamina _colourStamina = _colourDefault; - ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText + ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText format[" %2 - %3%1 - %4 - %5%1 - %6%1 - %9 - %18 - %8%1 + %3%1 + %4 + %5%1 + %6%1 + %9 + %18 + %8%1 %19:%20 FPS: %7 GRIDREF: %16", - "%", + "%", _players, _damage, - _wallet, - _hunger, - _thirst, - _serverFPS, - _energyPercent, - _stamina, + _wallet, + _hunger, + _thirst, + _serverFPS, + _energyPercent, + _stamina, _colourDefault, _colourDamage, _colourHunger, _colourThirst, _colourEnergy, _colourStamina, - format["%1/%2",_xx,_yy], + format["%1/%2",_xx,_yy], _colourToxicity, _toxPercent, _hours, _minutes - - + + ]; }; -}; \ No newline at end of file +}; diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar_WS.sqf b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar_WS.sqf index a0858b2..a5e64a7 100644 --- a/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar_WS.sqf +++ b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar_WS.sqf @@ -22,24 +22,24 @@ disableSerialization; _colour10 = parseText "#CC3300"; _colour0 = parseText "#CC0000"; _colourDead = parseText "#000000"; - - - - while {true} do + + + + while {true} do { - + sleep 1; - + //moved the creation of the status bar inside the loop and create it if it is null, - //this is to handle instance where the status bar is disappearing + //this is to handle instance where the status bar is disappearing if(isNull ((uiNamespace getVariable "statusBar")displayCtrl 55555)) then { diag_log "statusbar is null create"; disableSerialization; _rscLayer = "statusBar" call BIS_fnc_rscLayer; _rscLayer cutRsc["statusBar","PLAIN"]; - }; - + }; + //initialize variables and set values _unit = _this select 0; _damage = round ((1 - (damage player)) * 100); @@ -53,13 +53,13 @@ disableSerialization; _serverFPS = if (typeName EPOCH_diag_fps == "SCALAR") then [{EPOCH_diag_fps},{"MANIPULATED"}], _pos = getPosATL player; //switch to this below if you want to have world space coords displayed instead of gridref _dir = getDir (vehicle player); - _grid = mapGridPosition player; _xx = (format[_grid]) select [0,3]; - _yy = (format[_grid]) select [3,3]; + _grid = mapGridPosition player; _xx = (format[_grid]) select [0,3]; + _yy = (format[_grid]) select [3,3]; _time = (round(240-(serverTime)/60)); //edit the '240' value (60*4=240) to change the countdown timer if your server restarts are shorter or longer than 4 hour intervals _hours = (floor(_time/60)); _minutes = (_time - (_hours * 60)); - _players = (count playableunits -1); - + _players = (count playableunits); + switch(_minutes) do { case 9: {_minutes = "09"}; case 8: {_minutes = "08"}; @@ -72,11 +72,11 @@ disableSerialization; case 1: {_minutes = "01"}; case 0: {_minutes = "00"}; }; - + //Colour coding //Damage _colourDamage = _colourDefault; - + switch true do { case(_damage >= 100) : {_colourDamage = _colour100;}; case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour90;}; @@ -91,8 +91,8 @@ disableSerialization; case((_damage >= 1) && (_damage < 10)) : {_colourDamage = _colour0;}; case(_damage < 1) : {_colourDamage = _colourDead;}; }; - - + + //Hunger _colourHunger = _colourDefault; switch true do { @@ -109,9 +109,9 @@ disableSerialization; case((_hunger >= 1) && (_hunger < 10)) : {_colourHunger = _colour0;}; case(_hunger < 1) : {_colourHunger = _colourDead;}; }; - + //Thirst - _colourThirst = _colourDefault; + _colourThirst = _colourDefault; switch true do{ case(_thirst >= 100) : {_colourThirst = _colour100;}; case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour90;}; @@ -126,7 +126,7 @@ disableSerialization; case((_thirst >= 1) && (_thirst < 10)) : {_colourThirst = _colour0;}; case(_thirst < 1) : {_colourThirst = _colourDead;}; }; - + //Energy _colourEnergy = _colourDefault; switch true do{ @@ -143,7 +143,7 @@ disableSerialization; case((_energyPercent >= 1) && (_energyPercent < 10)) : {_colourEnergy = _colour0;}; case(_energyPercent < 1) : {_colourEnergy = _colour0;}; }; - + //Toxicity _colourToxicity = _colourDefault; switch true do{ @@ -160,44 +160,44 @@ disableSerialization; case((_toxPercent >= 1) && (_toxPercent < 10)) : {_colourToxicity = _colour90;}; case(_toxPercent < 1) : {_colourToxicity = _colour100;}; }; - + //Stamina _colourStamina = _colourDefault; - - //display the information - ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText + + //display the information + ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText format[" %2 - %3%1 - %4 - %5%1 - %6%1 - %9 - %19 - %8%1 + %3%1 + %4 + %5%1 + %6%1 + %9 + %19 + %8%1 FPS: %7 POS: %16 DIR: %17", - "%", + "%", _players, _damage, - _wallet, - _hunger, - _thirst, - _serverFPS, - _energyPercent, - _stamina, + _wallet, + _hunger, + _thirst, + _serverFPS, + _energyPercent, + _stamina, _colourDefault, _colourDamage, _colourHunger, _colourThirst, _colourEnergy, _colourStamina, - _pos, + _pos, _dir, _colourToxicity, _toxPercent ]; - + }; -}; \ No newline at end of file +}; diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/playerBar.sqf b/Server/mpmissions/epoch.Bornholm/addons/status_bar/playerBar.sqf index 3334646..6d5c159 100644 --- a/Server/mpmissions/epoch.Bornholm/addons/status_bar/playerBar.sqf +++ b/Server/mpmissions/epoch.Bornholm/addons/status_bar/playerBar.sqf @@ -22,22 +22,22 @@ disableSerialization; _colour10 = parseText "#CC3300"; _colour0 = parseText "#CC0000"; _colourDead = parseText "#000000"; - - - while {true} do + + + while {true} do { sleep 1; - + //moved the creation of the status bar inside the loop and create it if it is null, - //this is to handle instance where the status bar is disappearing + //this is to handle instance where the status bar is disappearing if(isNull ((uiNamespace getVariable "statusBar")displayCtrl 55555)) then { diag_log "statusbar is null create"; disableSerialization; _rscLayer = "statusBar" call BIS_fnc_rscLayer; _rscLayer cutRsc["statusBar","PLAIN"]; - }; - + }; + //initialize variables and set values _unit = _this select 0; _damage = round ((1 - (damage player)) * 100); @@ -50,15 +50,15 @@ disableSerialization; _energy = round(EPOCH_playerEnergy); _energyPercent = floor((_energy / 2500 ) * 100); _fps = format["%1", diag_fps]; - _grid = mapGridPosition player; - _xx = (format[_grid]) select [0,3]; - _yy = (format[_grid]) select [3,3]; + _grid = mapGridPosition player; + _xx = (format[_grid]) select [0,3]; + _yy = (format[_grid]) select [3,3]; _time = (round(240-(serverTime)/60)); //edit the '240' value (60*4=240) to change the countdown timer if your server restarts are shorter or longer than 4 hour intervals _hours = (floor(_time/60)); _minutes = (_time - (_hours * 60)); - _players = (count playableUnits -1); - - + _players = (count playableUnits); + + switch(_minutes) do { case 9: {_minutes = "09"}; case 8: {_minutes = "08"}; @@ -71,12 +71,12 @@ disableSerialization; case 1: {_minutes = "01"}; case 0: {_minutes = "00"}; }; - - + + //Colour coding //Damage _colourDamage = _colourDefault; - + switch true do { case(_damage >= 100) : {_colourDamage = _colour100;}; case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour90;}; @@ -91,7 +91,7 @@ disableSerialization; case((_damage >= 1) && (_damage < 10)) : {_colourDamage = _colour0;}; case(_damage < 1) : {_colourDamage = _colourDead;}; }; - + //Hunger _colourHunger = _colourDefault; switch true do { @@ -108,11 +108,11 @@ disableSerialization; case((_hunger >= 1) && (_hunger < 10)) : {_colourHunger = _colour0;}; case(_hunger < 1) : {_colourHunger = _colourDead;}; }; - + //Thirst - _colourThirst = _colourDefault; + _colourThirst = _colourDefault; switch true do{ - + case(_thirst >= 100) : {_colourThirst = _colour100;}; case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour90;}; case((_thirst >= 80) && (_thirst < 90)) : {_colourThirst = _colour80;}; @@ -126,11 +126,11 @@ disableSerialization; case((_thirst >= 1) && (_thirst < 10)) : {_colourThirst = _colour0;}; case(_thirst < 1) : {_colourThirst = _colourDead;}; }; - + //Energy _colourEnergy = _colourDefault; switch true do{ - + case(_energyPercent >= 100) : {_colourEnergy = _colour100;}; case((_energyPercent >= 90) && (_energyPercent < 100)) : {_colourEnergy = _colour90;}; case((_energyPercent >= 80) && (_energyPercent < 90)) : {_colourEnergy = _colour80;}; @@ -144,7 +144,7 @@ disableSerialization; case((_energyPercent >= 1) && (_energyPercent < 10)) : {_colourEnergy = _colour0;}; case(_energyPercent < 1) : {_colourEnergy = _colour0;}; }; - + //Toxicity _colourToxicity = _colourDefault; switch true do{ @@ -161,32 +161,32 @@ disableSerialization; case((_toxPercent >= 1) && (_toxPercent < 10)) : {_colourToxicity = _colour90;}; case(_toxPercent < 1) : {_colourToxicity = _colour100;}; }; - + //Stamina _colourStamina = _colourDefault; - - //display the information - ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText + + //display the information + ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText format[" %2 - %3%1 - %4 - %5%1 - %6%1 + %3%1 + %4 + %5%1 + %6%1 %9 %20 - %8%1 + %8%1 FPS: %7 GRIDREF: %16 %17:%18", - "%", + "%", _players, _damage, - _wallet, - _hunger, - _thirst, - round diag_fps, - _energyPercent, + _wallet, + _hunger, + _thirst, + round diag_fps, + _energyPercent, _stamina, _colourDefault, _colourDamage, @@ -199,11 +199,11 @@ disableSerialization; _minutes, _colourToxicity, _toxPercent - + ]; - - - - - }; -}; \ No newline at end of file + + + + + }; +};