Clock bug
#1

I have bug in my speedometer textdraw, each textdraw i have there is a little part of white "the clock" like in the single player. How do i can remove it (look on speedometer numbers)

Reply
#2

show please your textdraw code
Reply
#3

Код:
//4all
new Text:Black0;
new Text:White1;
new Text:White2;
new Text:White3;
new Text:BlackHealth;
new Text:DarkRedHealth;
new Text:BlackSpeed;
new Text:DarkYellowSpeed;
new Text:Marker;
new Text:Exclamation;

//4player
new Text:VHS[MAX_PLAYERS];
new Text:LightRedHealth[MAX_PLAYERS];
new Text:LightYellowSpeed[MAX_PLAYERS];

//Speed
new Float:OldX[MAX_PLAYERS];
new Float:OldY[MAX_PLAYERS];
new Float:OldZ[MAX_PLAYERS];

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

public OnFilterScriptInit()
{
	Black0 = TextDrawCreate(481.000000,353.000000,"_");
	TextDrawUseBox(Black0,1);
	TextDrawBoxColor(Black0,0x00000099);
	TextDrawTextSize(Black0,596.000000,0.000000);
	TextDrawAlignment(Black0,0);
	TextDrawBackgroundColor(Black0,0x000000ff);
	TextDrawFont(Black0,3);
	TextDrawLetterSize(Black0,3.599999,7.599996);
	TextDrawColor(Black0,0xffffffff);
	TextDrawSetOutline(Black0,1);
	TextDrawSetProportional(Black0,1);
	TextDrawSetShadow(Black0,1);

	White1 = TextDrawCreate(482.000000,354.000000,"_");
	TextDrawUseBox(White1,1);
	TextDrawBoxColor(White1,0xffffff66);
	TextDrawTextSize(White1,595.000000,-2.000000);
	TextDrawAlignment(White1,0);
	TextDrawBackgroundColor(White1,0x000000ff);
	TextDrawFont(White1,1);
	TextDrawLetterSize(White1,1.700000,7.399997);
	TextDrawColor(White1,0xffffffff);
	TextDrawSetOutline(White1,1);
	TextDrawSetProportional(White1,1);
	TextDrawSetShadow(White1,1);

	White2 = TextDrawCreate(483.000000,355.000000,"_");
	TextDrawUseBox(White2,1);
	TextDrawBoxColor(White2,0xffffff33);
	TextDrawTextSize(White2,594.000000,0.000000);
	TextDrawAlignment(White2,0);
	TextDrawBackgroundColor(White2,0x000000ff);
	TextDrawFont(White2,1);
	TextDrawLetterSize(White2,0.299999,7.199996);
	TextDrawColor(White2,0xffffffff);
	TextDrawSetOutline(White2,1);
	TextDrawSetProportional(White2,1);
	TextDrawSetShadow(White2,1);

	White3 = TextDrawCreate(484.000000,356.000000,"_");
	TextDrawUseBox(White3,1);
	TextDrawBoxColor(White3,0xffffff33);
	TextDrawTextSize(White3,593.000000,-2.000000);
	TextDrawAlignment(White3,0);
	TextDrawBackgroundColor(White3,0x000000ff);
	TextDrawFont(White3,3);
	TextDrawLetterSize(White3,1.000000,7.000000);
	TextDrawColor(White3,0xffffffff);
	TextDrawSetOutline(White3,1);
	TextDrawSetProportional(White3,1);
	TextDrawSetProportional(White3,1);
	TextDrawSetShadow(White3,1);

	BlackHealth = TextDrawCreate(487.000000,385.000000,"_");
	TextDrawUseBox(BlackHealth,1);
	TextDrawBoxColor(BlackHealth,0x00000099);
	TextDrawTextSize(BlackHealth,590.000000,-11.000000);
	TextDrawAlignment(BlackHealth,0);
	TextDrawBackgroundColor(BlackHealth,0x000000ff);
	TextDrawFont(BlackHealth,3);
	TextDrawLetterSize(BlackHealth,1.000000,0.399999);
	TextDrawColor(BlackHealth,0xffffffff);
	TextDrawSetOutline(BlackHealth,1);
	TextDrawSetProportional(BlackHealth,1);
	TextDrawSetShadow(BlackHealth,1);

	DarkRedHealth = TextDrawCreate(488.000000,386.000000,"_");
	TextDrawUseBox(DarkRedHealth,1);
	TextDrawBoxColor(DarkRedHealth,0xff000066);
	TextDrawTextSize(DarkRedHealth,589.000000,0.000000);
	TextDrawAlignment(DarkRedHealth,0);
	TextDrawBackgroundColor(DarkRedHealth,0x000000ff);
	TextDrawFont(DarkRedHealth,3);
	TextDrawLetterSize(DarkRedHealth,1.000000,0.199999);
	TextDrawColor(DarkRedHealth,0xffffffff);
	TextDrawSetOutline(DarkRedHealth,1);
	TextDrawSetProportional(DarkRedHealth,1);
	TextDrawSetShadow(DarkRedHealth,1);

	BlackSpeed = TextDrawCreate(536.000000,403.000000,"_");
	TextDrawUseBox(BlackSpeed,1);
	TextDrawBoxColor(BlackSpeed,0x00000099);
	TextDrawTextSize(BlackSpeed,590.000000,0.000000);
	TextDrawAlignment(BlackSpeed,0);
	TextDrawBackgroundColor(BlackSpeed,0x000000ff);
	TextDrawFont(BlackSpeed,3);
	TextDrawLetterSize(BlackSpeed,1.000000,1.400000);
	TextDrawColor(BlackSpeed,0xffffffff);
	TextDrawSetOutline(BlackSpeed,1);
	TextDrawSetShadow(BlackSpeed,1);
	TextDrawSetProportional(BlackSpeed,1);

	DarkYellowSpeed = TextDrawCreate(537.000000,404.000000,"_");
	TextDrawUseBox(DarkYellowSpeed,1);
	TextDrawBoxColor(DarkYellowSpeed,0xffff0033);
	TextDrawTextSize(DarkYellowSpeed,589.000000,0.000000);
	TextDrawAlignment(DarkYellowSpeed,0);
	TextDrawBackgroundColor(DarkYellowSpeed,0x000000ff);
	TextDrawFont(DarkYellowSpeed,3);
	TextDrawLetterSize(DarkYellowSpeed,1.000000,1.200000);
	TextDrawColor(DarkYellowSpeed,0xffffffff);
	TextDrawSetOutline(DarkYellowSpeed,1);
	TextDrawSetProportional(DarkYellowSpeed,1);
	TextDrawSetShadow(DarkYellowSpeed,1);

	Marker = TextDrawCreate(511.000000,382.000000,"l");
	TextDrawAlignment(Marker,0);
	TextDrawBackgroundColor(Marker,0x000000ff);
	TextDrawFont(Marker,1);
	TextDrawLetterSize(Marker,0.099999,1.000000);
	TextDrawColor(Marker,0xffffffff);
	TextDrawSetOutline(Marker,1);
	TextDrawSetProportional(Marker,1);
	TextDrawSetShadow(Marker,1);

	Exclamation = TextDrawCreate(579.000000,351.000000,"~r~!");
	TextDrawAlignment(Exclamation,0);
	TextDrawBackgroundColor(Exclamation,0x000000ff);
	TextDrawFont(Exclamation,2);
	TextDrawLetterSize(Exclamation,1.200000,3.399999);
	TextDrawColor(Exclamation,0xffffffff);
	TextDrawSetOutline(Exclamation,1);
	TextDrawSetProportional(Exclamation,1);
	TextDrawSetShadow(Exclamation,1);

	CheckStatusTimer = SetTimer("CheckStatus", 1000, 1);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

public OnFilterScriptExit()
{
	KillTimer(CheckStatusTimer);

	TextDrawDestroy(Text:Black0);
	TextDrawDestroy(Text:White1);
	TextDrawDestroy(Text:White2);
	TextDrawDestroy(Text:White3);
	TextDrawDestroy(Text:BlackHealth);
	TextDrawDestroy(Text:DarkRedHealth);
	TextDrawDestroy(Text:BlackSpeed);
	TextDrawDestroy(Text:DarkYellowSpeed);
	TextDrawDestroy(Text:Marker);
	TextDrawDestroy(Text:Exclamation);
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		TextDrawDestroy(Text:VHS[i]);
		TextDrawDestroy(Text:LightRedHealth[i]);
		TextDrawDestroy(Text:LightYellowSpeed[i]);
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

public OnPlayerConnect(playerid)
{
	TextDrawsShown[playerid] = false;
	VHSCreated[playerid] = false;
	LightRedHealthCreated[playerid] = false;
	LightYellowSpeedCreated[playerid] = false;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

public CheckStatus()
{
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(IsPlayerInAnyVehicle(i))
			{

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

				if(TextDrawsShown[i] == false)
				{
				    TextDrawShowForPlayer(i, Text:Black0);
				    TextDrawShowForPlayer(i, Text:White1);
				    TextDrawShowForPlayer(i, Text:White2);
				    TextDrawShowForPlayer(i, Text:White3);
				    TextDrawShowForPlayer(i, Text:BlackHealth);
				    TextDrawShowForPlayer(i, Text:DarkRedHealth);
				    TextDrawShowForPlayer(i, Text:BlackSpeed);
				    TextDrawShowForPlayer(i, Text:DarkYellowSpeed);
				    TextDrawShowForPlayer(i, Text:Marker);
				    TextDrawsShown[i] = true;
				}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

			    new String[128];
		        new Float:X, Float:Y, Float:Z, Float:Distance;
	            GetPlayerPos(i, X, Y, Z);
	            Distance = floatsqroot(floatadd(floatadd(floatpower(floatsub(X, OldX[i]), 2), floatpower(floatsub(Y, OldY[i]), 2)), floatpower(floatsub(Z, OldZ[i]), 2)));
				new PlayerVehicleModelID = GetVehicleModel(GetPlayerVehicleID(i));
				PlayerVehicleModelID -= 400;
				format(String,sizeof(String),"~b~Vehicle:~n~~w~%s~n~~b~Health:~n~~n~Speed:~n~~w~%im/h~n~%ikm/h", PlayerVehicle[PlayerVehicleModelID], floatround(floatmul(floatdiv(Distance, 1.609344), 2.0), floatround_floor), floatround(floatmul(Distance, 2.0), floatround_floor));
				if(VHSCreated[i] == true)
				{
					TextDrawDestroy(VHS[i]);
				}
				VHS[i] = TextDrawCreate(485.000000,355.000000,String);
				TextDrawAlignment(VHS[i],0);
				TextDrawBackgroundColor(VHS[i],0x000000ff);
				TextDrawFont(VHS[i],1);
				TextDrawLetterSize(VHS[i],0.299999,1.000000);
				TextDrawColor(VHS[i],0xffffffff);
				TextDrawSetOutline(VHS[i],1);
				TextDrawSetProportional(VHS[i],1);
				TextDrawSetShadow(VHS[i],1);
            	TextDrawShowForPlayer(i, VHS[i]);
            	VHSCreated[i] = true;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

				new Float:CarHealth;
				GetVehicleHealth(GetPlayerVehicleID(i), CarHealth);
				if(LightRedHealthCreated[i] == true)
				{
					TextDrawDestroy(LightRedHealth[i]);
				}
				LightRedHealth[i] = TextDrawCreate(488.000000,386.000000,"_");
				TextDrawUseBox(LightRedHealth[i],1);
				TextDrawBoxColor(LightRedHealth[i],0xff000099);
				TextDrawTextSize(LightRedHealth[i], floatadd(484.0, floatdiv(CarHealth, 9.5238095238)),0.000000);
				TextDrawAlignment(LightRedHealth[i],0);
				TextDrawBackgroundColor(LightRedHealth[i],0x000000ff);
				TextDrawFont(LightRedHealth[i],3);
				TextDrawLetterSize(LightRedHealth[i],1.000000,0.199999);
				TextDrawColor(LightRedHealth[i],0xffffffff);
				TextDrawSetOutline(LightRedHealth[i],1);
				TextDrawSetProportional(LightRedHealth[i],1);
				TextDrawSetShadow(LightRedHealth[i],1);
            	TextDrawShowForPlayer(i, LightRedHealth[i]);
            	LightRedHealthCreated[i] = true;
				if(CarHealth < 250)
				{
					if(ExclamationShown[i] == true)
					{
						TextDrawHideForPlayer(i, Text:Exclamation);
					    ExclamationShown[i] = false;
					}
					else
					{
						TextDrawShowForPlayer(i, Text:Exclamation);
					    ExclamationShown[i] = true;
					}
				}
				else if(CarHealth > 250)
				{
					if(ExclamationShown[i] == true)
					{
						TextDrawHideForPlayer(i, Text:Exclamation);
					    ExclamationShown[i] = false;
					}
				}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

				if(LightYellowSpeedCreated[i] == true)
				{
					TextDrawDestroy(LightYellowSpeed[i]);
				}
				LightYellowSpeed[i] = TextDrawCreate(537.000000,404.000000,"_");
				TextDrawUseBox(LightYellowSpeed[i],1);
				TextDrawBoxColor(LightYellowSpeed[i],0xffff0066);
				if(Distance >= 75)
				{
					TextDrawTextSize(LightYellowSpeed[i],589.000000,0.000000);
				}
				else
				{
					TextDrawTextSize(LightYellowSpeed[i], floatadd(533.0, floatdiv(Distance, 1.33928571428)),0.000000);
				}
				TextDrawAlignment(LightYellowSpeed[i],0);
				TextDrawBackgroundColor(LightYellowSpeed[i],0x000000ff);
				TextDrawFont(LightYellowSpeed[i],3);
				TextDrawLetterSize(LightYellowSpeed[i],1.000000,1.200000);
				TextDrawColor(LightYellowSpeed[i],0xffffffff);
				TextDrawSetOutline(LightYellowSpeed[i],1);
				TextDrawSetProportional(LightYellowSpeed[i],1);
				TextDrawSetShadow(LightYellowSpeed[i],1);
            	TextDrawShowForPlayer(i, LightYellowSpeed[i]);
            	LightYellowSpeedCreated[i] = true;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	            OldX[i] = X; OldY[i] = Y; OldZ[i] = Z;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

			}
			else
			{
			    if(TextDrawsShown[i] == true)
			    {
					TextDrawHideForPlayer(i, Text:Black0);
					TextDrawHideForPlayer(i, Text:White1);
					TextDrawHideForPlayer(i, Text:White2);
					TextDrawHideForPlayer(i, Text:White3);
					TextDrawHideForPlayer(i, Text:BlackHealth);
					TextDrawHideForPlayer(i, Text:DarkRedHealth);
					TextDrawHideForPlayer(i, Text:BlackSpeed);
					TextDrawHideForPlayer(i, Text:DarkYellowSpeed);
					TextDrawHideForPlayer(i, Text:Marker);
					TextDrawHideForPlayer(i, Text:Exclamation);
				    TextDrawsShown[i] = false;
				}
				TextDrawHideForPlayer(i, Text:VHS[i]);
				TextDrawHideForPlayer(i, Text:LightRedHealth[i]);
				TextDrawHideForPlayer(i, Text:LightYellowSpeed[i]);
			}
		}
	}
}
Reply
#4

Does this "22" value change?

Find in your gamemode "gettime()" function. Maybe you use textdraw that earlier was textdraw for displaying time.
Reply
#5

I dont see any textdraws above or under function gettime()
BTW i didn't script this speedometer, i downloaded it from samp forums
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)