SA-MP Forums Archive
Text Draw doesn't appear! - 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: Text Draw doesn't appear! (/showthread.php?tid=488190)



Text Draw doesn't appear! - Tayab - 17.01.2014

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.


Re: Text Draw doesn't appear! - Tayab - 18.01.2014

Still unresolved!


Re: Text Draw doesn't appear! - amirab - 18.01.2014

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


Re: Text Draw doesn't appear! - Tayab - 18.01.2014

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


Re: Text Draw doesn't appear! - Hansrutger - 18.01.2014

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

Is OnGameModeInit?


Re: Text Draw doesn't appear! - ikey07 - 18.01.2014

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.


Re: Text Draw doesn't appear! - Hansrutger - 18.01.2014

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.


Re: Text Draw doesn't appear! - Tayab - 19.01.2014

It is in OnGameModeInit.

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