Hallo NN-Community,
ich habe diesen Error. Nur ich weiß nicht was der Fehler ist
Code
22:06:13 Error Nicht definierte Variable in Ausdruck: _hours
22:06:13 File mpmissions\__CUR_MP.Altis\core\statusLeiste.sqf, line 173
22:06:14 Error in expression <colourThirst,
format["%1/%2",_xx,_yy],
_hours,
_minutes,
_geld,
_colourgeld,
_p>
22:06:14 Error position: <_hours,
_minutes,
_geld,
_colourgeld,
_p>
Alles anzeigen
Hier die ganze Datei:
Code: statusLeiste.sqf
waitUntil {!(isNull (findDisplay 46))};
disableSerialization;
_rscLayer = "statusBar" call BIS_fnc_rscLayer;
_rscLayer cutRsc["statusBar","PLAIN"];
systemChat format["Lade Informationen...", _rscLayer];
[] spawn {
sleep 5;
//set the color values.
//Additional color codes can be found here: http://html-color-codes.com/
_colourDefault = parseText "#ADADAD"; //set your default colour here
_colour100 = parseText "#336600";
_colour90 = parseText "#339900";
_colour80 = parseText "#33CC00";
_colour70 = parseText "#33FF00";
_colour60 = parseText "#66FF00";
_colour50 = parseText "#CCFF00";
_colour40 = parseText "#CCCC00";
_colour30 = parseText "#CC9900";
_colour20 = parseText "#CC6600";
_colour10 = parseText "#CC3300";
_colour0 = parseText "#CC0000";
_colourDead = parseText "#000000";
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 2)) 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);
_hunger = life_hunger;
_thirst = life_thirst;
_geld = [life_cash] call life_fnc_numberText;
_cash = life_cash;
_bank = [life_atmcash] call life_fnc_numberText;
_bankcash = life_atmcash;
_serverFPS = round diag_fps;
_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];
//_time = (round(360-(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 = civilian countSide playableUnits;
_police = west countSide playableUnits;
_ars = east countSide playableUnits;
_arzt = independent countSide playableUnits;
//Colour coding
//Damage
_colourDamage = _colourDefault;
switch true do {
case(_damage >= 100) : {_colourDamage = _colour100;};
case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour90;};
case((_damage >= 80) && (_damage < 90)) : {_colourDamage = _colour80;};
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;};
};
//Hunger
_colourHunger = _colourDefault;
switch true do {
case(_hunger >= 100) : {_colourHunger = _colour100;};
case((_hunger >= 90) && (_hunger < 100)) : {_colourHunger = _colour90;};
case((_hunger >= 80) && (_hunger < 90)) : {_colourHunger = _colour80;};
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 = _colour100;};
case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour90;};
case((_thirst >= 80) && (_thirst < 90)) : {_colourThirst = _colour80;};
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;};
};
//geld
_colourgeld = _colourDefault;
switch true do{
case(_cash <= 10000) : {_colourgeld = _colour100;};
case((_cash >= 10001) && (_cash < 24999)) : {_colourgeld = _colour90;};
case((_cash >= 25000) && (_cash < 49999)) : {_colourgeld = _colour80;};
case((_cash >= 50000) && (_cash < 74999)) : {_colourgeld = _colour70;};
case((_cash >= 75000) && (_cash < 99999)) : {_colourgeld = _colour60;};
case((_cash >= 100000) && (_cash < 249999)) : {_colourgeld = _colour50;};
case((_cash >= 250000) && (_cash < 499999)) : {_colourgeld = _colour40;};
case((_cash >= 500000) && (_cash < 999999)) : {_colourgeld = _colour30;};
case(_cash >= 1000000) : {_colourgeld = _colour0;};
};
//bank
_colourbank = _colourDefault;
switch true do{
case(_bankcash <= 10000) : {_colourbank = _colour0;};
case((_bankcash >= 10001) && (_bankcash < 24999)) : {_colourbank = _colour30;};
case((_bankcash >= 25000) && (_bankcash < 49999)) : {_colourbank = _colour40;};
case((_bankcash >= 50000) && (_bankcash < 74999)) : {_colourbank = _colour50;};
case((_bankcash >= 75000) && (_bankcash < 99999)) : {_colourbank = _colour60;};
case((_bankcash >= 100000) && (_bankcash < 249999)) : {_colourbank = _colour70;};
case((_bankcash >= 250000) && (_bankcash < 499999)) : {_colourbank = _colour80;};
case((_bankcash >= 500000) && (_bankcash < 999999)) : {_colourbank = _colour90;};
case(_bankcash >= 1000000) : {_colourbank = _colour100;};
};
((uiNamespace getVariable "statusBar")displayCtrl 2)ctrlSetStructuredText parseText
format["
<t shadow='1' shadowColor='#000000' color='%7'><img size='1.6' shadowColor='#000000' image='icons\status_bar\players.paa' color='%7'/> %2</t>
<t shadow='1' shadowColor='#000000' color='%7'><img size='1.6' shadowColor='#000000' image='icons\status_bar\polizei.paa' color='%7'/> %16</t>
<t shadow='1' shadowColor='#000000' color='%7'><img size='1.6' shadowColor='#000000' image='icons\status_bar\ars.paa' color='%7'/> %17</t>
<t shadow='1' shadowColor='#000000' color='%7'><img size='1.6' shadowColor='#000000' image='icons\status_bar\arzt.paa' color='%7'/> %18</t>
<t shadow='1' shadowColor='#000000' color='%8'><img size='1.6' shadowColor='#000000' image='icons\status_bar\damage.paa' color='%7'/> %3%1</t>
<t shadow='1' shadowColor='#000000' color='%9'><img size='1.6' shadowColor='#000000' image='icons\status_bar\food.paa' color='%7'/> %4%1</t>
<t shadow='1' shadowColor='#000000' color='%10'><img size='1.6' shadowColor='#000000' image='icons\status_bar\water.paa' color='%7'/> %5%1</t>
<t shadow='1' shadowColor='#000000' color='%20'><img size='1.6' shadowColor='#000000' image='icons\status_bar\bank.paa' color='%7'/> %19</t>
<t shadow='1' shadowColor='#000000' color='%15'><img size='1.6' shadowColor='#000000' image='icons\status_bar\money.paa' color='%7'/> %14</t>
<t shadow='1' shadowColor='#000000' color='%7'>GRIDREF: %11</t>
<t shadow='1' shadowColor='#000000' color='%7'>FPS: %6</t>",
"%",
_players,
_damage,
_hunger,
_thirst,
_serverFPS,
_colourDefault,
_colourDamage,
_colourHunger,
_colourThirst,
format["%1/%2",_xx,_yy],
_hours,
_minutes,
_geld,
_colourgeld,
_police,
_ars,
_arzt,
_bank,
_colourbank
];
};
};
Alles anzeigen