SA-MP Forums Archive
Textdraw Strings? - 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 Strings? (/showthread.php?tid=317103)



Textdraw Strings? - Swyft™ - 10.02.2012

pawn Код:
/* Player Stats Bar TEXTDRAW */
    new string[256];
    Textdraw1 = TextDrawCreate(36.000000, 431.000000, string);
    TextDrawBackgroundColor(Textdraw1, 255);
    TextDrawFont(Textdraw1, 1);
    TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
    TextDrawColor(Textdraw1, -1);
    TextDrawSetOutline(Textdraw1, 0);
    TextDrawSetProportional(Textdraw1, 1);
    TextDrawSetShadow(Textdraw1, 1);

    format(string, sizeof(string), "%s | Money: %s", szPlayerName, GetPlayerMoney(playerid));
    TextDrawShowForPlayer(playerid, Textdraw1);
It is suppose to appear but it doesn't, and yes the coordinates are correct!

EDIT: It compiles fine, but it doesn't show


Re: Textdraw Strings? - Jefff - 10.02.2012

1. Muste be new Text:Textdraw1[MAX_PLAYERS]; and then Textdraw1[playerid] = TextDrawCreate(....
2.
pawn Код:
format(string, sizeof(string), "%s | Money: %d", szPlayerName, GetPlayerMoney(playerid));
TextDrawSetString(Textdraw1[playerid],string);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);



Re : Textdraw Strings? - rbcrp - 10.02.2012

Yes and you also need to put the format(string, sizeof(string) above the start of the textdraw so that it can draw the information from it, with it below it can confuse it. You might also want to change new string to new textdraw or something. it doesnt matter what you use as the new as long as you have [#] after it. For example.

new string[128];

=

new textdrawstring[128];

just makes it more unique. And Jefff is right, you have to make it Textdraw1[MAX_PLAYERS] for it to call for each person instead of everyone at once.


Re: Re : Textdraw Strings? - Swyft™ - 10.02.2012

Quote:
Originally Posted by rbcrp
Посмотреть сообщение
Yes and you also need to put the format(string, sizeof(string) above the start of the textdraw so that it can draw the information from it, with it below it can confuse it. You might also want to change new string to new textdraw or something. it doesnt matter what you use as the new as long as you have [#] after it. For example.

new string[128];

=

new textdrawstring[128];

just makes it more unique. And Jefff is right, you have to make it Textdraw1[MAX_PLAYERS] for it to call for each person instead of everyone at once.
I did it all and it STILL doesnt work