Textdraw doesn't show.
#1

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
Reply
#2

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);
}
Reply
#3

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.
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)