TextDraw - 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: TextDraw (
/showthread.php?tid=476474)
TextDraw -
appleomax - 18.11.2013
Is it possible to create TextDraws using for loop?
I have tried that, but it didn't worked.
Код HTML:
new Text:TD[5];
OnGameModeInit()
{
new Float: x, Float: y;
x = 146.0;
y = 156.0;
for(new i = 0; i < 5; i++)
{
TD[i] = TextDrawCreate(x+=10.0, y+=10.0, "Text");
}
}
Can anyone give me an example how to do it?
AW: TextDraw -
Skimmer - 18.11.2013
You don't need to create extra variable for the cords.
pawn Код:
new Text:TD[5];
public OnGameModeInit()
{
new Float: x, Float: y;
for(new i = 0; i < sizeof(TD); i++)
{
TD[i] = TextDrawCreate(156.0, 166.0, "Text");
}
return 1;
}
Re: TextDraw -
appleomax - 18.11.2013
Thanks, but what I have to do to print out TextDraws in for loop like this:
Text
Text
Text
Is it even possible?
Re: TextDraw -
-Prodigy- - 18.11.2013
Yes it's possible, try this:
pawn Код:
new Text:TD[5];
OnGameModeInit()
{
new Float: x = 146.0, Float: y = 156.0;
for(new i = 0; i < sizeof(TD); i++)
{
TD[i] = TextDrawCreate(x, y, "Text");
x += 10, y += 10;
}
}