SA-MP Forums Archive
Textdraw doesn't show. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraw doesn't show. (/showthread.php?tid=265176)



Textdraw doesn't show. - Jochemd - 29.06.2011

Hello,

I got a problem with this textdraw. It won't show up when TextDrawShowForPlayer is used. Here's code:

pawn Код:
new Text:InfoBoxDraw[MAX_PLAYERS]; // Located at top of script
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i ++) // This code is located in OnGameModeInit
    {
        InfoBoxDraw[i] = TextDrawCreate(500.000000, 130.000000, "~w~bladi");
        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 Код:
stock SetInfoBoxMessage(playerid,message[],time = -1)
{
    if(GetPVarInt(playerid,"ShowingInfoBox") == 1) KillTimer(GetPVarInt(playerid,"InfoBoxTimer"));
    TextDrawSetString(InfoBoxDraw[playerid],message);
    TextDrawShowForPlayer(playerid,InfoBoxDraw[playerid]);
    PlayerPlaySound(playerid,1083,0.0,0.0,0.0); //<== This sound plays fine, so the stock works.
    if(time != -1)
    {
        SetPVarInt(playerid,"InfoBoxTimer",SetTimerEx("OnInfoBoxHide",time,0,"i",playerid));
        SetPVarInt(playerid,"ShowingInfoBox",1);
    }
    return 1;
}
I know the positions and etcetera are OK cause I created them using Zamaroht's TextdrawCreator. What could be the reason then?

Jochem


Re: Textdraw doesn't show. - =WoR=Varth - 29.06.2011

pawn Код:
OnPlayerSpawn(playerid)
{
    InfoBoxDraw[playerid] = TextDrawCreate(500.000000, 130.000000, "~w~bladi");
    TextDrawBackgroundColor(InfoBoxDraw[playerid], 255);
    TextDrawFont(InfoBoxDraw[playerid], 1);
    TextDrawLetterSize(InfoBoxDraw[playerid], 0.260000, 0.899999);
    TextDrawColor(InfoBoxDraw[playerid], -1);
    TextDrawSetOutline(InfoBoxDraw[playerid], 1);
    TextDrawSetProportional(InfoBoxDraw[playerid], 1);
    TextDrawUseBox(InfoBoxDraw[playerid], 1);
    TextDrawBoxColor(InfoBoxDraw[playerid], 1734837503);
    TextDrawTextSize(InfoBoxDraw[playerid], 636.000000, 0.000000);
}



Re: Textdraw doesn't show. - Jochemd - 30.06.2011

Are you sure that makes any difference between using it there or OnPlayerConnect or a loop in OnGameModeInit? I'll try it anyway. (OnPlayerConnect didn't work before)

Edit: Didn't work.


Re: Textdraw doesn't show. - [GTA-PR]Temper - 01.07.2011

I had this problem once,but don't remember how i solved.I'll try to remember..