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(playerid, 320.0 - 50.0, 480.0 - 20.0, " ");
PlayerTextDrawAlignment(playerid, xpBarTD[playerid][0], 1);
PlayerTextDrawUseBox(playerid, xpBarTD[playerid][0], true);
PlayerTextDrawTextSize(playerid, xpBarTD[playerid][0], 100.0, 15.0);
PlayerTextDrawBoxColor(playerid, xpBarTD[playerid][0], 0x000000AA);
PlayerTextDrawLetterSize(playerid, xpBarTD[playerid][0], 0.48 , 1.6);
PlayerTextDrawBackgroundColor(playerid, xpBarTD[playerid][0], 0x000000AA);
// and 3 other TDs just like this...
}
and here is to show up:
PHP код:
stock RefreshXPBar(playerid)
{
new xpstr[23];
format(xpstr, sizeof xpstr, "%i / 0", pInfo[playerid][pXP]);
PlayerTextDrawSetString(playerid, xpBarTD[playerid][2], xpstr);
PlayerTextDrawShow(playerid, xpBarTD[playerid][0]);
PlayerTextDrawShow(playerid, xpBarTD[playerid][1]);
PlayerTextDrawShow(playerid, xpBarTD[playerid][2]);
PlayerTextDrawShow(playerid, xpBarTD[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", 2000, true, "i", playerid);
}
Re: Textdraws Not Shown -
AnnaSB - 14.05.2015
bump... any ideas?