TextDraw is duplicated unnecessarily
#3

Quote:
Originally Posted by Tass007
Посмотреть сообщение
This is untested but this may help.
PHP код:
if(GPLon[vehid]==1)
{
    if(
Gas[vehid]<=100 || Gas[vehid]>=70)
    {
        
format(stringsizeof(string), "~g~......");
        
PlayerTextDrawSetString(playerid,SpeedometerText[playerid][3],string);
        
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);
        
PlayerTextDrawFont(playeridSpeedometerText[playerid][3], 1);
    }
    else if(
Gas[vehid]<70 || Gas[vehid]>=50)
    {
        
format(stringsizeof(string), "~g~.....~w~.");
        
PlayerTextDrawSetString(playerid,SpeedometerText[playerid][3],string);
        
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);
    }
    else if(
Gas[vehid]<50 || Gas[vehid]>=40)
    {
        
format(stringsizeof(string), "~g~....~w~..");
        
PlayerTextDrawSetString(playerid,SpeedometerText[playerid][3],string);
        
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);
    }
    else if(
Gas[vehid]<40 || Gas[vehid]>=30)
    {
        
format(stringsizeof(string), "~y~...~w~...");
        
PlayerTextDrawSetString(playerid,SpeedometerText[playerid][3],string);
        
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);
    }
    else if(
Gas[vehid]<30 || Gas[vehid]>=20)
    {
        
format(stringsizeof(string), "~r~..~w~....");
        
PlayerTextDrawSetString(playerid,SpeedometerText[playerid][3],string);
        
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);
    }
    else if(
Gas[vehid]<20 || Gas[vehid]>=1)
    {
        
format(stringsizeof(string), "~r~.~w~.....");
        
PlayerTextDrawSetString(playerid,SpeedometerText[playerid][3],string);
        
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);
    }
    else if(
Gas[vehid]<=0)
    {
        
format(stringsizeof(string), "~r~......");
        
PlayerTextDrawSetString(playerid,SpeedometerText[playerid][3],string);
        
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);
    }

Equal...
Reply


Messages In This Thread
TextDraw is duplicated unnecessarily - by mikianto - 18.08.2016, 08:36
Re: TextDraw is duplicated unnecessarily - by Tass007 - 18.08.2016, 08:42
Re: TextDraw is duplicated unnecessarily - by mikianto - 18.08.2016, 08:54
Re: TextDraw is duplicated unnecessarily - by Tass007 - 18.08.2016, 08:58
Re: TextDraw is duplicated unnecessarily - by Vince - 18.08.2016, 09:05
Re: TextDraw is duplicated unnecessarily - by mikianto - 18.08.2016, 09:05
Re: TextDraw is duplicated unnecessarily - by mikianto - 18.08.2016, 09:07
Re: TextDraw is duplicated unnecessarily - by Tass007 - 18.08.2016, 09:11
Re: TextDraw is duplicated unnecessarily - by Vince - 18.08.2016, 11:18

Forum Jump:


Users browsing this thread: 1 Guest(s)