A Textdraw isn't showing (script 100% right) -
Jochemd - 02.07.2011
Hello,
I've been searching for this bug now days (yes, serious, days), and I can't find any script bug. Maybe it's a SA-MP bug? The positions of my textdraw are all allright. Here is some script:
pawn Code:
new Text:InfoBoxDraw[MAX_PLAYERS]; // (located at top of script)
pawn Code:
for(new i = 0; i < MAX_PLAYERS; i ++) // MAX_PLAYERS is 100 here. (located in OnGameModeInit)
{
InfoBoxDraw[i] = TextDrawCreate(500.000000, 130.000000, "~w~bladi"); // 500 - 130
TextDrawBackgroundColor(InfoBoxDraw[i], 255);
TextDrawFont(InfoBoxDraw[i], 1);
TextDrawLetterSize(InfoBoxDraw[i], 0.260000, 0.899999);
TextDrawColor(InfoBoxDraw[i], -1);
TextDrawSetOutline(InfoBoxDraw[i], 1);
TextDrawSetProportional(InfoBoxDraw[i], 1);
TextDrawUseBox(InfoBoxDraw[i], 1);
TextDrawBoxColor(InfoBoxDraw[i], 1734837503);
TextDrawTextSize(InfoBoxDraw[i], 636.000000, 0.000000);
}
pawn Code:
stock SetInfoBoxMessage(playerid,message[],time = -1)
{
if(GetPVarInt(playerid,"ShowingInfoBox") == 1) KillTimer(GetPVarInt(playerid,"InfoBoxTimer"));
TextDrawShowForPlayer(playerid,InfoBoxDraw[playerid]);
TextDrawSetString(InfoBoxDraw[playerid],message);
PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
if(time != -1)
{
SetPVarInt(playerid,"InfoBoxTimer",SetTimerEx("OnInfoBoxHide",time,0,"i",playerid));
SetPVarInt(playerid,"ShowingInfoBox",1);
}
return 1;
}
The draw isn't out-screen at all? I wonder why it is no working, since everything is pretty ok. The textdraw is made with Zamaroht's Textdraw Creator.
Jochem
Re: A Textdraw isn't showing (script 100% right) -
xxmitsu - 02.07.2011
https://sampwiki.blast.hk/wiki/Limits
Textdraws Limit
Have you passed over that limit ? In your code, you're allready creating 100
EDIT: I might have got this wrong.. The TD isn't displayed at all or the position is wrong ?
Re: A Textdraw isn't showing (script 100% right) -
Jochemd - 02.07.2011
It;'s not displaying at all.
Re: A Textdraw isn't showing (script 100% right) -
Donya - 02.07.2011
500.000000, 130.000000? isnt 500 off screen? try like 370.0 just for testing
wait i think its 600+
what about your textsize x? 636? maybe its that..
Re: A Textdraw isn't showing (script 100% right) -
Jochemd - 02.07.2011
It works with that editor, good pos.
Re: A Textdraw isn't showing (script 100% right) -
Donya - 02.07.2011
try creating it when a player connects, then destroying when they disconnect.
Re: A Textdraw isn't showing (script 100% right) -
Jochemd - 02.07.2011
I've already tried that
Re: A Textdraw isn't showing (script 100% right) -
=WoR=Varth - 03.07.2011
Quote:
Originally Posted by Donya
try creating it when a player connects, then destroying when they disconnect.
|
Quote:
Originally Posted by Jochemd
I've already tried that 
|
Did you use loop in OnPlayerConnect?
Re: A Textdraw isn't showing (script 100% right) -
Miguel - 03.07.2011
OnGameModeInit (before creating any textdraw):
pawn Code:
TextDrawCreate(0.0, 0.0, " ");
Re: A Textdraw isn't showing (script 100% right) -
=WoR=Varth - 03.07.2011
Quote:
Originally Posted by Miguel
OnGameModeInit (before creating any textdraw):
pawn Code:
TextDrawCreate(0.0, 0.0, " ");
|
Actually you don't have to do this because me myself never do this and my TD is works perfectly.
Re: A Textdraw isn't showing (script 100% right) -
Miguel - 03.07.2011
Mine used to work pefectly until somehow, I managed to reproduce this random bug that wouldn't let some textdraws show. I searched a bit and I found that work around posted above. I suggest using that line, even if your textdraws are working correctly.
Re: A Textdraw isn't showing (script 100% right) -
Jochemd - 03.07.2011
Too bad, this didnt help.
Re: A Textdraw isn't showing (script 100% right) -
Jochemd - 03.07.2011
I fixed it somehow by putting the textdraw as the first creating.
Re: A Textdraw isn't showing (script 100% right) -
leong124 - 03.07.2011
Quote:
Originally Posted by Jochemd
I fixed it somehow by putting the textdraw as the first creating.
|
I've found similar problems as yours, and the solution is to initialise the arrays.
pawn Код:
new Text:InfoBoxDraw[MAX_PLAYERS] = {Text:INVALID_TEXT_DRAW,...}; // (located at top of script)
I still don't very understand why it is required, but it really fixes it