TextDraw is duplicated unnecessarily
#1

Help! I have this problem:



This is code:

Quote:

if(GPLon[vehid]==1)
{
if(Gas[vehid]<=100 || Gas[vehid]>=70)
{
format(string, sizeof(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(playerid, SpeedometerText[playerid][3], 1);
}
else if(Gas[vehid]<70 || Gas[vehid]>=50)
{
format(string, sizeof(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(string, sizeof(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(string, sizeof(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(string, sizeof(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(string, sizeof(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(string, sizeof(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);
}
}
else
{
format(string, sizeof(string), "......");
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);
}

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)