SA-MP Forums Archive
Textdraws Not Shown - 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: Textdraws Not Shown (/showthread.php?tid=574022)



Textdraws Not Shown - AnnaSB - 12.05.2015

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


Re: Textdraws Not Shown - Joe Staff - 12.05.2015

Verify that they're being created.


Re: Textdraws Not Shown - AnnaSB - 12.05.2015

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


Re: Textdraws Not Shown - Joe Staff - 12.05.2015

Are all of your TextDraws just a space?


Re: Textdraws Not Shown - AnnaSB - 12.05.2015

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).


Re: Textdraws Not Shown - Joe Staff - 12.05.2015

And none of them at all show?


Re: Textdraws Not Shown - AnnaSB - 12.05.2015

None.


Re: Textdraws Not Shown - Joe Staff - 12.05.2015

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.


Re: Textdraws Not Shown - AnnaSB - 14.05.2015

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);




Re: Textdraws Not Shown - AnnaSB - 14.05.2015

bump... any ideas?