Textdraws Not Shown
#1

Hi there,
I have a few PlayerTextDraws, but they seem not to be showing up.
The syntax is completely checked, td array is dumped and is OK, and the debuginfo clarifies that the function (RefreshXPBar) is called, and has never went to stop or fail, so each PlayerTextDrawShow instance is called successfully.
PHP код:
stock CreateXPBar(playerid)
{
    
// Background
    
xpBarTD[playerid][0] = CreatePlayerTextDraw(playerid320.0 50.0480.0 20.0" ");
    
PlayerTextDrawAlignment(playeridxpBarTD[playerid][0], 1);
    
PlayerTextDrawUseBox(playeridxpBarTD[playerid][0], true);
    
PlayerTextDrawTextSize(playeridxpBarTD[playerid][0], 100.015.0);
    
PlayerTextDrawBoxColor(playeridxpBarTD[playerid][0], 0x000000AA);
    
PlayerTextDrawLetterSize(playeridxpBarTD[playerid][0], 0.48 1.6);
    
PlayerTextDrawBackgroundColor(playeridxpBarTD[playerid][0], 0x000000AA);
    
// and 3 other TDs just like this...

and here is to show up:
PHP код:
stock RefreshXPBar(playerid)
{
    new 
xpstr[23];
    
format(xpstrsizeof xpstr"%i / 0"pInfo[playerid][pXP]);
    
PlayerTextDrawSetString(playeridxpBarTD[playerid][2], xpstr);
    
PlayerTextDrawShow(playeridxpBarTD[playerid][0]);
    
PlayerTextDrawShow(playeridxpBarTD[playerid][1]);
    
PlayerTextDrawShow(playeridxpBarTD[playerid][2]);
    
PlayerTextDrawShow(playeridxpBarTD[playerid][3]);

I hope you can help, it's really strange
Reply
#2

Verify that they're being created.
Reply
#3

It's verified, as I said, dumped the array xpBarTD and was like [0] => 4, [1] => 5, ...
Reply
#4

Are all of your TextDraws just a space?
Reply
#5

No, just two of them are, [0] and [1], as they are a background and a progress bar, [2] [3] [4] have text inside, however, [4] is also initially blank (space).
Reply
#6

And none of them at all show?
Reply
#7

None.
Reply
#8

Well the code is correct, if you put what you've shown into a filterscript and test it, it'll work fine.
Which means your problems lies else where.

Maybe your displaying to the wrong player or something.
Reply
#9

It doesn't ever seem to, the function RefreshXPBar is called right where other TD functions are called, right inside the OnPlayerSpawn callback, others work, this one doesn't.
PHP код:
public OnPlayerSpawn(playerid)
{
...
    
RefreshXPBar(playerid); // not working
...
    
RefreshHud(playerid); // working well
    
KillTimer(phRefreshTimer[playerid]);
    
phRefreshTimer[playerid] = SetTimerEx("RefreshHud"2000true"i"playerid);

Reply
#10

bump... any ideas?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)