Text Draw doesn't appear!
#1

Hi, I've been trying to make a label for my Progress Bars through TextDraw but for some reason it doesn't appear. I get the X and Y coordinates of the bar and increment X by 2 points. Here is my code.

pawn Код:
//NEWs
new Text:thirsttext;

thirsttext = TextDrawCreate(539.00, 134.00,"Thirst: ");
ThirstBar[i] = CreateProgressBar(549.00, 134.00,55.50, 3.20, 1490286591, 100.0);

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid,thirsttext);
    ShowProgressBarForPlayer(playerid,ThirstBar[playerid]);
    return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid,thirsttext);
    ShowProgressBarForPlayer(playerid,ThirstBar[playerid]);
    return 1;
}
Any required code will be provided. Please help ASAP.
Reply
#2

Still unresolved!
Reply
#3

Oh My God
you just create it and say i made a TextDraw?!
My Bro....
you should set font
you should set color
you should set letter size
and .........
not just TextDrawCreate
Reply
#4

I've done all of that, still I can't see it on my screen.
Reply
#5

thirsttext = TextDrawCreate(539.00, 134.00,"Thirst: ");

Is OnGameModeInit?
Reply
#6

Are you aware that new Text:thirsttext; should be a player textdraw new PlayerText:thirsttext[playerid]; , because you wont show the same bar for all players.

Also could be that your thirsttext is under that progress bar, you should use player text draw.
Reply
#7

Quote:
Originally Posted by ikey07
Посмотреть сообщение
Are you aware that new Text:thirsttext; should be a player textdraw new PlayerText:thirsttext[playerid]; , because you wont show the same bar for all players.

Also could be that your thirsttext is under that progress bar, you should use player text draw.
Wrong, he uses TextDrawCreate and not CreatePlayerTextDraw. He shows it to a specific playerid and a valid ID.

https://sampwiki.blast.hk/wiki/TextDrawShowForPlayer is for TextDrawCreate.
https://sampwiki.blast.hk/wiki/PlayerTextDrawShow is for CreatePlayerTextDraw.

Repeated solution:
Please add your "TextDrawCreate" on OnGameModeInit, as with most things you have to create the object, in this case textdraw, once the server starts. I think this would be the solution.
Reply
#8

It is in OnGameModeInit.

And I want it to be a global textdraw so there is no point making thirsttext a player variable.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)