Textdraw Strings?
#1

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
Reply
#2

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]);
Reply
#3

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.
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)