SA-MP Forums Archive
TextDraws Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: TextDraws Help (/showthread.php?tid=665661)



TextDraws Help - DarkWorldJack - 12.04.2019

ENG:
Hi, I'm creating a textdraw for vehicle life, this below is the textdraw with the code:
ITA:
Ciao, sto creando un textdraw per la vita dei veicoli, questo qui sotto и il textdraw con il codice:

//Vehicle Health
Quote:

Danni_veicolo[playerid] = TextDrawCreate(482.234344, 404.816894, "usebox");
TextDrawLetterSize(Danni_veicolo[playerid], 0.000000, -9.172124);
TextDrawTextSize(Danni_veicolo[playerid], 471.534454, 0.000000);
TextDrawAlignment(Danni_veicolo[playerid], 1);
TextDrawUseBox(Danni_veicolo[playerid], true);
TextDrawBoxColor(Danni_veicolo[playerid], -16776961);
TextDrawSetShadow(Danni_veicolo[playerid], 0);
TextDrawSetOutline(Danni_veicolo[playerid], 0);

//SCRIPT
Quote:

if(health < 0)
{
TextDrawLetterSize(Danni_veicolo[playerid], 0.0, -0.565394);
}
else if(health >= 1000)
{
TextDrawLetterSize(Danni_veicolo[playerid], 0.0, -9.209616);
}
else
{
ENG:
How do I get it to match the life of the vehicle
ITA:
Come faccio a farlo combaciare con la vita del veicolo
Quote:

TextDrawLetterSize(Danni_veicolo[playerid], 0.0, floatadd(-9.209616, floatdiv(health, 10)));

}
TextDrawShowForPlayer(playerid, Danni_veicolo[playerid]);

//rod
Quote:

Asta_km[playerid] = TextDrawCreate(527.134216, 362.892089, "LD_SPAC:white");
TextDrawLetterSize(Asta_km[playerid], 0.000000, 0.000000);
TextDrawTextSize(Asta_km[playerid], -30.266456, 1.866667);
TextDrawAlignment(Asta_km[playerid], 1);
TextDrawColor(Asta_km[playerid], -5963521);
TextDrawSetShadow(Asta_km[playerid], 0);
TextDrawSetOutline(Asta_km[playerid], 0);
TextDrawFont(Asta_km[playerid], 4);

//SCRIPT
Quote:

if(velocity >= 0)
{
TextDrawSetPreviewRot(Asta_km[playerid], velocity + 70, 0, 0, 1);
}
else if(velocity > 260)
{
TextDrawSetPreviewRot(Asta_km[playerid], 280, 0, 0, 1);
}
TextDrawShowForPlayer(playerid, Asta_km[playerid]);

you can help me fix my script, thanks


Re: TextDraws Help - SiaReyes - 14.04.2019

What is the issue ?


Re: TextDraws Help - DarkWorldJack - 14.04.2019

Quote:
Originally Posted by SiaReyes
View Post
What is the issue ?
with 'Vehicle Health' I cannot insert the proportion of the work Y so 'userbox' goes down or the value of the life of the vehicle.

with 'rod' (Asta_km) it would be the auction that moves according to the KM that is running with a vehicle, but it remains still and flashes


Re: TextDraws Help - DarkWorldJack - 16.04.2019

is there anyone who can help me out?


Re: TextDraws Help - NaS - 16.04.2019

Could you show a screenshot of the issue? It might be easier to see what's wrong than just looking at numbers and guess what's wrong.

For the first one I understand that it doesn't scale properly to the health?

And for Asta_km you seem to use TextDrawSetPreviewRot although the TD you use is a sprite. TextDrawSetPreviewRot only works with preview models.


Re: TextDraws Help - DarkWorldJack - 17.04.2019

Quote:
Originally Posted by NaS
View Post
Could you show a screenshot of the issue? It might be easier to see what's wrong than just looking at numbers and guess what's wrong.

For the first one I understand that it doesn't scale properly to the health?

And for Asta_km you seem to use TextDrawSetPreviewRot although the TD you use is a sprite. TextDrawSetPreviewRot only works with preview models.
https://i.imgur.com/tFddYmL.png

//Asta_km
with Asta_km how can I make it die based on the speed of the vehicle?

//Health vehicle
The 'UserBox' you will see is the life of the vehicle, but when I crash into the vehicle, or it comes out of the black line or goes too low

if(health < 200.0) TextDrawLetterSize(Danni_veicolo[playerid], 0.0, -0.560);
else if(health >= 1000.0) TextDrawLetterSize(Danni_veicolo[playerid], 0.0, -7.517);
else TextDrawLetterSize(Danni_veicolo[playerid], 0.0, floatadd(-0.560, floatdiv(health, 9)));


Re: TextDraws Help - DarkWorldJack - 18.04.2019

Please help