[BUG] Flashing textdraw (and radio stations) -
ATomas - 15.12.2017
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;
}
}
Re: [BUG] Flashing textdraw (and radio stations) -
adri1 - 15.12.2017
It happens when show a model preview textdraw for player (because object have to load)
Re: [BUG] Flashing textdraw (and radio stations) -
ATomas - 15.12.2017
Quote:
Originally Posted by adri1
It happens when show a model preview textdraw for player (because object have to load)
|
OK, but radio stations flashing why ?
Re: [BUG] Flashing textdraw (and radio stations) -
Riddick94 - 15.12.2017
Quote:
Originally Posted by ATomas
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.
Re: [BUG] Flashing textdraw (and radio stations) -
Kar - 15.12.2017
Quote:
Originally Posted by Riddick94
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)
Re: [BUG] Flashing textdraw (and radio stations) -
Riddick94 - 15.12.2017
Quote:
Originally Posted by Kar
And TextDrawSetPosition (PlayerTextDrawSetPosition) 
|
Yes and no. Since YSF has done it already though. Not as critical/necessary as rotation IMO
Re: [BUG] Flashing textdraw (and radio stations) -
ModGuy - 15.12.2017
Also there's micro lag when showing model with TextDrawSetPreviewModel, that should be fixed.
Quote:
Originally Posted by Riddick94
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.
Re: [BUG] Flashing textdraw (and radio stations) -
RoboN1X - 16.12.2017
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.
Re: [BUG] Flashing textdraw (and radio stations) -
ATomas - 17.12.2017
Quote:
Originally Posted by RoboN1X
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