18.08.2016, 11:18
Color codes don't count. They're still part of the text.
That's still a lot more code than needed because the entire thing can essentially be compressed to this:
Quote:
I'd say. Don't constantly show the textdraw, just set the string.
PHP код:
|
PHP код:
new gasText[16] = "......";
if(GPLon[vehid]==1)
{
switch(Gas[vehid])
{
case 0: gasText = "~r~......";
case 1..19: gasText = "~r~.~w~.....";
case 20..29: gasText = "~r~..~w~....";
case 30..39: gasText = "~y~...~w~...";
case 40..49: gasText = "~g~....~w~..";
case 50..69: gasText = "~g~.....~w~.";
case 70..100: gasText = "~g~......";
default: gasText = "Malfunction";
}
}
PlayerTextDrawSetString(playerid,SpeedometerText[playerid][3],gasText);
PlayerTextDrawTextSize(playerid,SpeedometerText[playerid][3], 522+(iValue*89/200), 0);
PlayerTextDrawShow(playerid,SpeedometerText[playerid][3]);
PlayerTextDrawUseBox(playerid,SpeedometerText[playerid][3], 1);
PlayerTextDrawBoxColor(playerid,SpeedometerText[playerid][3], 0xFFFFFF00);