[BUG] Flashing textdraw (and radio stations)
#1

Hello,
i create this speedometer and see in video. Its flashing. Flashing red part and flashing radio station's name.

Video:
https://www.youtube.com/watch?v=QwyhzYKKR1g

Code:
Code:
new Text:tachometr,Text:rucicka;

public OnPlayerUpdate(playerid)
{
	new Float:rot,Float:rychlost,Float:x,Float:y,Float:z,vehicleid = GetPlayerVehicleID(playerid);
	if(IsPlayerInAnyVehicle(playerid))
	{
		GetVehicleVelocity(vehicleid,x,y,z);
		rychlost = VectorSize(x,y,z)*100.0*1.61;

		new s[128];
		format(s,128,"%f",rychlost);
		SendClientMessage(playerid,-1,s);

		if(rychlost < 30.0) rot = 51.0+(rychlost*1.2);
		else if(rychlost < 140.0) rot = 51.0+(rychlost*1.4);
		else  rot = 51.0+(rychlost*1.5);
		TextDrawSetPreviewRot(rucicka,90.0,0.0,rot,1.5);
		TextDrawShowForPlayer(playerid,rucicka);
	}
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext,"/tachometr",true) == 0)
	{
		tachometr = TextDrawCreate(450.0, 300.0, "mdl-2014:tachometr");
		TextDrawFont(tachometr, 4);
		TextDrawColor(tachometr,0xFFFFFFFF);
		TextDrawTextSize(tachometr,100.0,100.0);
		TextDrawShowForPlayer(playerid,tachometr);

		rucicka = TextDrawCreate(450.0, 300.0, "_");
		TextDrawFont(rucicka,TEXT_DRAW_FONT_MODEL_PREVIEW);
		TextDrawColor(rucicka,0xFFFFFFFF);
		TextDrawBackgroundColor(rucicka,0xFFFFFF00);
		TextDrawTextSize(rucicka,100.0,100.0);
		TextDrawSetPreviewModel(rucicka,-2014);
		TextDrawSetPreviewRot(rucicka,90.0,0.0,51.0,1.5);
		TextDrawShowForPlayer(playerid,rucicka);
		return 1;
	}
}
Reply
#2

It happens when show a model preview textdraw for player (because object have to load)
Reply
#3

Quote:
Originally Posted by adri1
View Post
It happens when show a model preview textdraw for player (because object have to load)
OK, but radio stations flashing why ?
Reply
#4

Quote:
Originally Posted by ATomas
View Post
OK, but radio stations flashing why ?
Most likely related to the every "show" of the textdraw. That is why Kalcor should add rotation support for the sprites/textdraws. Try removing/hiding your textdraws and see IN-GAME if that still happens.
Reply
#5

Quote:
Originally Posted by Riddick94
View Post
Most likely related to the every "show" of the textdraw. That is why Kalcor should add rotation support for the sprites/textdraws. Try removing/hiding your textdraws and see IN-GAME if that still happens.
And TextDrawSetPosition (PlayerTextDrawSetPosition)
Reply
#6

Quote:
Originally Posted by Kar
View Post
And TextDrawSetPosition (PlayerTextDrawSetPosition)
Yes and no. Since YSF has done it already though. Not as critical/necessary as rotation IMO
Reply
#7

Also there's micro lag when showing model with TextDrawSetPreviewModel, that should be fixed.

Quote:
Originally Posted by Riddick94
View Post
Yes and no. Since YSF has done it already though. Not as critical/necessary as rotation IMO
Why do we need to use memory hacking plugins to achieve that? Kalcor should add functions from YSF.
Reply
#8

I made a similar script once but using neon tube lamps from sa-mp objects as the needle, it does work without flashing the radio stations textdraw.

Try with a non custom model, it will work good. So yeah, probably a bug or it was made like that.

I used a PlayerTextdraw thought.
Reply
#9

Quote:
Originally Posted by RoboN1X
View Post
I made a similar script once but using neon tube lamps from sa-mp objects as the needle, it does work without flashing the radio stations textdraw.

Try with a non custom model, it will work good. So yeah, probably a bug or it was made like that.

I used a PlayerTextdraw thought.
I had try PlayerTextDraw and non custom model. But still radio station flashing
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)