[Tutorial] Statusbar / Infoleiste
-
- Altis Life
-
Xylometachlorid -
20. Oktober 2015 um 14:33
-
-
@Motombo
So?Code
Alles anzeigen/* Player Status Bar with Icons v 1.36 Author: Dart_Rogue Mod: Epoch https://github.com/DarthRogue/Status_Bar Transfered to Altis Life + add SBUserhy */ waitUntil {!(isNull (findDisplay 46))}; disableSerialization; 4 cutRsc ["osefStatusBar","PLAIN"]; systemChat format["Willkommen auf dem Server", _rscLayer]; [] spawn { sleep 2; _counter = 360; _timeSinceLastUpdate = 0; _colourDefault = parseText "#ADADAD"; //set your default colour here _colour100 = parseText "#33FF00"; _colour90 = parseText "#33FF00"; _colour80 = parseText "#33FF00"; _colour70 = parseText "#33FF00"; _colour60 = parseText "#66FF00"; _colour50 = parseText "#CCFF00"; _colour40 = parseText "#FFFF00"; _colour30 = parseText "#FFFF00"; _colour20 = parseText "#CC0000"; _colour10 = parseText "#CC0000"; _colour0 = parseText "#CC0000"; _colourDead = parseText "#000000"; _colourUpTimeHUD = parseText "#CCCCCC"; 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 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 //neu _CivplayHUD = civilian countSide playableUnits; _WestplayHUD = west countSide playableUnits; _IndepplayHUD = independent countSide playableUnits; _EastplayHUD = east countSide playableUnits; _grid = mapGridPosition player; _xx = (format[_grid]) select [0,3]; _yy = (format[_grid]) select [3,3]; _hunger = round(life_hunger); _thirst = round(life_thirst); _damage = round ((1 - (damage player)) * 100); _FpsHud = round (diag_fps); _stamina = round(getFatigue player * 100) / 100; _UpTimeHUD = [serverTime,"HH:MM:SS"] call BIS_fnc_secondsToString; //neu ende _toxPercent = round(life_thirst); _energy = round(life_thirst); _energyPercent = floor((_energy / 2500 ) * 100); _players = (count playableUnits -1); //Colour coding //Hunger _colourHunger = _colourDefault; switch true do { case(_hunger >= 100) : {_colourHunger = _colour70;}; case((_hunger >= 90) && (_hunger < 100)) : {_colourHunger = _colour70;}; case((_hunger >= 80) && (_hunger < 90)) : {_colourHunger = _colour70;}; case((_hunger >= 70) && (_hunger < 80)) : {_colourHunger = _colour70;}; case((_hunger >= 60) && (_hunger < 70)) : {_colourHunger = _colour60;}; case((_hunger >= 50) && (_hunger < 60)) : {_colourHunger = _colour50;}; case((_hunger >= 40) && (_hunger < 50)) : {_colourHunger = _colour40;}; case((_hunger >= 30) && (_hunger < 40)) : {_colourHunger = _colour30;}; case((_hunger >= 20) && (_hunger < 30)) : {_colourHunger = _colour20;}; case((_hunger >= 10) && (_hunger < 20)) : {_colourHunger = _colour10;}; case((_hunger >= 1) && (_hunger < 10)) : {_colourHunger = _colour0;}; case(_hunger < 1) : {_colourHunger = _colourDead;}; }; //Thirst _colourThirst = _colourDefault; switch true do{ case(_thirst >= 100) : {_colourThirst = _colour70;}; case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour70;}; case((_thirst >= 80) && (_thirst < 90)) : {_colourThirst = _colour70;}; case((_thirst >= 70) && (_thirst < 80)) : {_colourThirst = _colour70;}; case((_thirst >= 60) && (_thirst < 70)) : {_colourThirst = _colour60;}; case((_thirst >= 50) && (_thirst < 60)) : {_colourThirst = _colour50;}; case((_thirst >= 40) && (_thirst < 50)) : {_colourThirst = _colour40;}; case((_thirst >= 30) && (_thirst < 40)) : {_colourThirst = _colour30;}; case((_thirst >= 20) && (_thirst < 30)) : {_colourThirst = _colour20;}; case((_thirst >= 10) && (_thirst < 20)) : {_colourThirst = _colour10;}; case((_thirst >= 1) && (_thirst < 10)) : {_colourThirst = _colour0;}; case(_thirst < 1) : {_colourThirst = _colourDead;}; }; //Damage _colourDamage = _colourDefault; switch true do { case(_damage >= 100) : {_colourDamage = _colour70;}; case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour70;}; case((_damage >= 80) && (_damage < 90)) : {_colourDamage = _colour70;}; case((_damage >= 70) && (_damage < 80)) : {_colourDamage = _colour70;}; case((_damage >= 60) && (_damage < 70)) : {_colourDamage = _colour60;}; case((_damage >= 50) && (_damage < 60)) : {_colourDamage = _colour50;}; case((_damage >= 40) && (_damage < 50)) : {_colourDamage = _colour40;}; case((_damage >= 30) && (_damage < 40)) : {_colourDamage = _colour30;}; case((_damage >= 20) && (_damage < 30)) : {_colourDamage = _colour20;}; case((_damage >= 10) && (_damage < 20)) : {_colourDamage = _colour10;}; case((_damage >= 1) && (_damage < 10)) : {_colourDamage = _colour0;}; case(_damage < 1) : {_colourDamage = _colourDead;}; }; //Stamina _colourStamina = _colourDefault; switch true do{ case(_Stamina < 0.01) : {_colourStamina = _colour70;}; case((_Stamina >= 0.01) && (_Stamina < 0.3)) : {_colourStamina = _colour70;}; case((_Stamina >= 0.3) && (_Stamina < 0.6)) : {_colourStamina = _colour30;}; case(_Stamina >= 0.6) : {_colourStamina = _colour0;}; }; //FPS _colourFps = _colourDefault; switch true do { case(_FpsHud >= 60) : {_colourFps = _colour70;}; case((_FpsHud >= 30) && (_FpsHud < 60)) : {_colourFps = _colour30;}; case((_FpsHud >= 1) && (_FpsHud < 30)) : {_colourFps = _colour0;}; case(_FpsHud < 1) : {_colourFps = _colourDead;}; }; ((uiNamespace getVariable "osefStatusBar")displayCtrl 555556)ctrlSetStructuredText parseText format["<t shadow='1' shadowColor='#000000'><img size='1.6' shadowColor='#000000' image='icons\Statusbar\players.paa' color='#FFFFFF'/>%1 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\players.paa' color='#3399FF'/>%2 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\players.paa' color='#009933'/>%3 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\players.paa' color='#CC0000'/>%4 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\ico_map.paa'/>%5 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\hunger.paa' color='%7'/>%6 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\thirst.paa' color='%9'/>%8 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\damage.paa' color='%11'/>%10 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\stamina.paa' color='%13'/>%12 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\monitor_fps.paa' color='%15'/>%14 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\restart.paa' color='%17'/>%16</t>",_CivplayHUD,_WestplayHUD,_IndepplayHUD,_EastplayHUD, format["%1/%2",_xx,_yy], _hunger, _colourHunger, _thirst, _colourThirst, _damage, _colourDamage, _stamina, _colourStamina, _FpsHud, _colourFps, _UpTimeHUD, _colourUpTimeHUD,_players,_energyPercent,_colourDefault]; }; };
-
Nicht ganz, _rscLayer ist jetzt nicht mehr definiert.
Du musst das einfach in Zeile 13 und 43/44 raus machen.Bei Zeile 13 kannst du die Zeile einfach löschen. (Braucht eh keiner)
- systemChat format["Willkommen auf dem Server", _rscLayer];
Bei Zeile 43/44 ersetzt du die beiden Zeilen:
- _rscLayer = "statusBar" call BIS_fnc_rscLayer;
- _rscLayer cutRsc["statusBar","PLAIN"];
+ 4 cutRSC ["osefStatusBar","PLAIN"]; -
@Larry
So ? xDCode
Alles anzeigen/* Player Status Bar with Icons v 1.36 Author: Dart_Rogue Mod: Epoch https://github.com/DarthRogue/Status_Bar Transfered to Altis Life + add SBUserhy */ waitUntil {!(isNull (findDisplay 46))}; disableSerialization; 4 cutRsc ["osefStatusBar","PLAIN"]; systemChat format["Willkommen auf dem Server", _rscLayer]; [] spawn { sleep 2; _counter = 360; _timeSinceLastUpdate = 0; _colourDefault = parseText "#ADADAD"; //set your default colour here _colour100 = parseText "#33FF00"; _colour90 = parseText "#33FF00"; _colour80 = parseText "#33FF00"; _colour70 = parseText "#33FF00"; _colour60 = parseText "#66FF00"; _colour50 = parseText "#CCFF00"; _colour40 = parseText "#FFFF00"; _colour30 = parseText "#FFFF00"; _colour20 = parseText "#CC0000"; _colour10 = parseText "#CC0000"; _colour0 = parseText "#CC0000"; _colourDead = parseText "#000000"; _colourUpTimeHUD = parseText "#CCCCCC"; 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 if(isNull ((uiNamespace getVariable "statusBar")displayCtrl 55555)) then { diag_log "statusbar is null create"; disableSerialization; 4 cutRSC ["osefStatusBar","PLAIN"]; }; //initialize variables and set values //neu _CivplayHUD = civilian countSide playableUnits; _WestplayHUD = west countSide playableUnits; _IndepplayHUD = independent countSide playableUnits; _EastplayHUD = east countSide playableUnits; _grid = mapGridPosition player; _xx = (format[_grid]) select [0,3]; _yy = (format[_grid]) select [3,3]; _hunger = round(life_hunger); _thirst = round(life_thirst); _damage = round ((1 - (damage player)) * 100); _FpsHud = round (diag_fps); _stamina = round(getFatigue player * 100) / 100; _UpTimeHUD = [serverTime,"HH:MM:SS"] call BIS_fnc_secondsToString; //neu ende _toxPercent = round(life_thirst); _energy = round(life_thirst); _energyPercent = floor((_energy / 2500 ) * 100); _players = (count playableUnits -1); //Colour coding //Hunger _colourHunger = _colourDefault; switch true do { case(_hunger >= 100) : {_colourHunger = _colour70;}; case((_hunger >= 90) && (_hunger < 100)) : {_colourHunger = _colour70;}; case((_hunger >= 80) && (_hunger < 90)) : {_colourHunger = _colour70;}; case((_hunger >= 70) && (_hunger < 80)) : {_colourHunger = _colour70;}; case((_hunger >= 60) && (_hunger < 70)) : {_colourHunger = _colour60;}; case((_hunger >= 50) && (_hunger < 60)) : {_colourHunger = _colour50;}; case((_hunger >= 40) && (_hunger < 50)) : {_colourHunger = _colour40;}; case((_hunger >= 30) && (_hunger < 40)) : {_colourHunger = _colour30;}; case((_hunger >= 20) && (_hunger < 30)) : {_colourHunger = _colour20;}; case((_hunger >= 10) && (_hunger < 20)) : {_colourHunger = _colour10;}; case((_hunger >= 1) && (_hunger < 10)) : {_colourHunger = _colour0;}; case(_hunger < 1) : {_colourHunger = _colourDead;}; }; //Thirst _colourThirst = _colourDefault; switch true do{ case(_thirst >= 100) : {_colourThirst = _colour70;}; case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour70;}; case((_thirst >= 80) && (_thirst < 90)) : {_colourThirst = _colour70;}; case((_thirst >= 70) && (_thirst < 80)) : {_colourThirst = _colour70;}; case((_thirst >= 60) && (_thirst < 70)) : {_colourThirst = _colour60;}; case((_thirst >= 50) && (_thirst < 60)) : {_colourThirst = _colour50;}; case((_thirst >= 40) && (_thirst < 50)) : {_colourThirst = _colour40;}; case((_thirst >= 30) && (_thirst < 40)) : {_colourThirst = _colour30;}; case((_thirst >= 20) && (_thirst < 30)) : {_colourThirst = _colour20;}; case((_thirst >= 10) && (_thirst < 20)) : {_colourThirst = _colour10;}; case((_thirst >= 1) && (_thirst < 10)) : {_colourThirst = _colour0;}; case(_thirst < 1) : {_colourThirst = _colourDead;}; }; //Damage _colourDamage = _colourDefault; switch true do { case(_damage >= 100) : {_colourDamage = _colour70;}; case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour70;}; case((_damage >= 80) && (_damage < 90)) : {_colourDamage = _colour70;}; case((_damage >= 70) && (_damage < 80)) : {_colourDamage = _colour70;}; case((_damage >= 60) && (_damage < 70)) : {_colourDamage = _colour60;}; case((_damage >= 50) && (_damage < 60)) : {_colourDamage = _colour50;}; case((_damage >= 40) && (_damage < 50)) : {_colourDamage = _colour40;}; case((_damage >= 30) && (_damage < 40)) : {_colourDamage = _colour30;}; case((_damage >= 20) && (_damage < 30)) : {_colourDamage = _colour20;}; case((_damage >= 10) && (_damage < 20)) : {_colourDamage = _colour10;}; case((_damage >= 1) && (_damage < 10)) : {_colourDamage = _colour0;}; case(_damage < 1) : {_colourDamage = _colourDead;}; }; //Stamina _colourStamina = _colourDefault; switch true do{ case(_Stamina < 0.01) : {_colourStamina = _colour70;}; case((_Stamina >= 0.01) && (_Stamina < 0.3)) : {_colourStamina = _colour70;}; case((_Stamina >= 0.3) && (_Stamina < 0.6)) : {_colourStamina = _colour30;}; case(_Stamina >= 0.6) : {_colourStamina = _colour0;}; }; //FPS _colourFps = _colourDefault; switch true do { case(_FpsHud >= 60) : {_colourFps = _colour70;}; case((_FpsHud >= 30) && (_FpsHud < 60)) : {_colourFps = _colour30;}; case((_FpsHud >= 1) && (_FpsHud < 30)) : {_colourFps = _colour0;}; case(_FpsHud < 1) : {_colourFps = _colourDead;}; }; ((uiNamespace getVariable "osefStatusBar")displayCtrl 555556)ctrlSetStructuredText parseText format["<t shadow='1' shadowColor='#000000'><img size='1.6' shadowColor='#000000' image='icons\Statusbar\players.paa' color='#FFFFFF'/>%1 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\players.paa' color='#3399FF'/>%2 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\players.paa' color='#009933'/>%3 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\players.paa' color='#CC0000'/>%4 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\ico_map.paa'/>%5 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\hunger.paa' color='%7'/>%6 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\thirst.paa' color='%9'/>%8 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\damage.paa' color='%11'/>%10 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\stamina.paa' color='%13'/>%12 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\monitor_fps.paa' color='%15'/>%14 <img size='1.6' shadowColor='#000000' image='icons\Statusbar\restart.paa' color='%17'/>%16</t>",_CivplayHUD,_WestplayHUD,_IndepplayHUD,_EastplayHUD, format["%1/%2",_xx,_yy], _hunger, _colourHunger, _thirst, _colourThirst, _damage, _colourDamage, _stamina, _colourStamina, _FpsHud, _colourFps, _UpTimeHUD, _colourUpTimeHUD,_players,_energyPercent,_colourDefault]; }; };
-
jetzt noch Zeile 13 löschen.
-
@Larry
Geht nicht xD
Also das gleiche Problem wie vorher ._. -
hast du RPT logs?
-
@Larry
steht nichts drin ._. -
-
Vielleicht weiß ja @Motombo was da zu tun ist xD
-
Keiner eine Idee?
-
öffne mal das komplette Script mit Notepad ++ und suche nach 4 cutText und 4 cutRsc
Sollte das irgendwo vorkommen, dann solltest du das abändern. Bestenfalls in 0 cutRsc/0 cutText
Wenn du das Ragecore Intro verwendest, dann musst du in der fn_initIntro.sqf folgendes
for "_x" from 5 to 25 do {
_x cutRsc ["RageCoreintro","PLAIN"];
};
mit folgendem
for "_x" from 5 to 25 do {
_x cutRsc ["RageCoreintro","PLAIN"];
};
ersetzten -
öffne mal das komplette Script mit Notepad ++ und suche nach 4 cutText und 4 cutRsc
Sollte das irgendwo vorkommen, dann solltest du das abändern. Bestenfalls in 0 cutRsc/0 cutText
Wenn du das Ragecore Intro verwendest, dann musst du in der fn_initIntro.sqf folgendes
for "_x" from 5 to 25 do {
_x cutRsc ["RageCoreintro","PLAIN"];
};
mit folgendem
for "_x" from 5 to 25 do {
_x cutRsc ["RageCoreintro","PLAIN"];
};
ersetzten@Larry
Ist das nicht zwei Mal das gleiche ? -
for "_x" from 0 to 25 do {
_x cutRsc ["RageCoreintro","PLAIN"];
};
mit folgendem
for "_x" from 5 to 25 do {
_x cutRsc ["RageCoreintro","PLAIN"];
};da rote ist geändert
-
@Larry
ich liebe dich xD
Vielen Dank !!! -
ich liebe dich xD
xD ich bin aber net schwul...
-
@Larry
#nohomo -
Moin hab nen kleines problem undzwar ich hab alles so gemacht wie es beschrieben war. Unser Server läuft auf 3.1.4.8 und jetzt wenn ich auf den server gehe schauts so aus. Würde gerne wissen ob dafür jemand ne Lösung hätte mfg.
-
Naja, wenn man Missionsdateien klaut und dann nicht weis was man wie editieren muss um dies und das einzufügen.. GG
Wieso Missionsdatein klauen? Es war ein scriptpack was zum Download freigegeben war. Und ja ich geb ja auch zu dass ich kein all so guter scripter bin aber mir zu unterstellen dass ich die Missionsdatein geklaut habe is net so toll
-
Moin hab nen kleines problem undzwar ich hab alles so gemacht wie es beschrieben war. Unser Server läuft auf 3.1.4.8 und jetzt wenn ich auf den server gehe schauts so aus. Würde gerne wissen ob dafür jemand ne Lösung hätte mfg.
Moin,
hast du Icons auch in den richtigen Ordner eingefügt?Lg
-