Advertisement
RionKillikus

playerbar.sqf

May 24th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.23 KB | None | 0 0
  1. waitUntil {!(isNull (findDisplay 46))};
  2. disableSerialization;
  3.  
  4. waitUntil{!isNull (findDisplay 38500)};
  5. waitUntil{isNull (findDisplay 38500)};
  6.  
  7. _rscLayer = "statusBar" call BIS_fnc_rscLayer;
  8. _rscLayer cutRsc["statusBar","PLAIN"];
  9. systemChat format["Status Bar...", _rscLayer];
  10. [] spawn
  11. {
  12.  
  13. sleep 5;
  14. //set the color values.
  15. //Additional color codes can be found here: http://html-color-codes.com/
  16. _colourDefault = parseText "#ADADAD"; //set your default colour here
  17. _colour100 = parseText "#336600";
  18. _colour90 = parseText "#339900";
  19. _colour80 = parseText "#33CC00";
  20. _colour70 = parseText "#33FF00";
  21. _colour60 = parseText "#66FF00";
  22. _colour50 = parseText "#CCFF00";
  23. _colour40 = parseText "#CCCC00";
  24. _colour30 = parseText "#CC9900";
  25. _colour20 = parseText "#CC6600";
  26. _colour10 = parseText "#CC3300";
  27. _colour0 = parseText "#CC0000";
  28. _colourDead = parseText "#000000";
  29.  
  30.  
  31. while {true} do
  32. {
  33. sleep 1;
  34.  
  35. //moved the creation of the status bar inside the loop and create it if it is null,
  36. //this is to handle instance where the status bar is disappearing
  37. if(isNull ((uiNamespace getVariable "statusBar")displayCtrl 55555)) then
  38. {
  39. diag_log "statusbar is null create";
  40. disableSerialization;
  41. _rscLayer = "statusBar" call BIS_fnc_rscLayer;
  42. _rscLayer cutRsc["statusBar","PLAIN"];
  43. };
  44.  
  45. //initialize variables and set values
  46. _unit = _this select 0;
  47. _nakit = [life_cash] call life_fnc_numberText;
  48. _bank = ([life_atmbank] call life_fnc_numberText);
  49. _fps = format["%1", diag_fps];
  50. _polis = (west countSide playableUnits);
  51. _doktor = (independent countSide playableUnits);
  52. _sivil = (civilian countSide playableUnits);
  53. _time = (round(1440-(serverTime)/60)); //edit the '1440' value (60*24=1440) to change the countdown timer if your server restarts are shorter or longer than 24 hour intervals
  54. _hours = (floor(_time/60));
  55. _minutes = (_time - (_hours * 60));
  56. _players = (count playableUnits);
  57.  
  58.  
  59. switch(_minutes) do {
  60. case 9: {_minutes = "09"};
  61. case 8: {_minutes = "08"};
  62. case 7: {_minutes = "07"};
  63. case 6: {_minutes = "06"};
  64. case 5: {_minutes = "05"};
  65. case 4: {_minutes = "04"};
  66. case 3: {_minutes = "03"};
  67. case 2: {_minutes = "02"};
  68. case 1: {_minutes = "01"};
  69. case 0: {_minutes = "00"};
  70. };
  71.  
  72.  
  73. //Colour coding
  74. //Damage
  75.  
  76.  
  77. //Stamina
  78.  
  79. //display the information
  80. ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText
  81. format["
  82. <t shadow='1' shadowColor='#000000' color='%10'><img size='1.6' shadowColor='#000000' image='scripts\status_bar\images\players.paa' color='%10'/> %2</t>
  83. <t shadow='1' shadowColor='#000000' color='%11'><img size='1.6' shadowColor='#000000' image='scripts\status_bar\images\polis.paa' color='%11'/> %3</t>
  84. <t shadow='1' shadowColor='#000000' color='%11'><img size='1.6' shadowColor='#000000' image='scripts\status_bar\images\doktor.paa' color='%11'/> %4</t>
  85. <t shadow='1' shadowColor='#000000' color='%11'><img size='1.6' shadowColor='#000000' image='scripts\status_bar\images\sivil.paa' color='%11'/> %5</t>
  86. <t shadow='1' shadowColor='#000000' color='%10'><img size='1.6' shadowColor='#000000' image='scripts\status_bar\images\nakit.paa' color='%10'/> %6</t>
  87. <t shadow='1' shadowColor='#000000' color='%12'><img size='1.6' shadowColor='#000000' image='scripts\status_bar\images\banka.paa' color='%12'/> %11</t>
  88. <t shadow='1' shadowColor='#000000' color='%10'>FPS: %7</t>
  89. <t shadow='1' shadowColor='#000000' color='%10'><img size='1.6' shadowColor='#000000' image='scripts\status_bar\images\ts3.paa' color='%10'/>104.238.221.242:9019</t>
  90. <t shadow='1' shadowColor='#000000' color='%10'><img size='1.6' shadowColor='#000000' image='scripts\status_bar\images\restart.paa' color='%10'/>Restart: %9:%10</t>
  91. <t shadow='1' shadowColor='#000000' color='%10'><img size='1.6' shadowColor='#000000' image='scripts\status_bar\images\icon.paa' color='%10'/> </t>",
  92. "%",
  93. _players,
  94. _polis,
  95. _doktor,
  96. _sivil,
  97. _nakit,
  98. round diag_fps,
  99. format["%1/%2",_xx,_yy],
  100. _hours,
  101. _minutes,
  102. _bank
  103.  
  104. ];
  105.  
  106.  
  107.  
  108.  
  109. };
  110. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement