Problem
#1

So, I am trying to make something like a chat in a textdraw.
But sometimes, the last line duplicates and it shows the same message on 1 line(the last one).
Here's a picture of it:




Here's my code:
pawn Код:
stock UpdateInfoBox(const text[])
{
    if(currentline == 1)
    {
        SendBoxMsg(1,text);
        SendBoxMsg(3,line3text);
        currentline = 2;
        format(line1text,128,"%s",text);
    }
    else if(currentline == 2)
    {
        SendBoxMsg(1,text);
        SendBoxMsg(2,line1text);
        currentline = 3;
        format(line2text,128,"%s",text);
    }
    else if(currentline == 3)
    {
        SendBoxMsg(1,text);
        SendBoxMsg(2,line2text);
        SendBoxMsg(3,line1text);
        format(line3text,128,"%s",text);
        currentline = 1;
    }
    return 1;
}

stock SendBoxMsg(line,const msg[])
{
    new string[128];
    if(line == 1)
    {
        format(string,sizeof(string),"%s",msg);
        TextDrawSetString(Infoline1,string);
        TextDrawShowForAll(Infoline1);
    }
    else if(line == 2)
    {
        format(string,sizeof(string),"%s",msg);
        TextDrawSetString(Infoline2,string);
        TextDrawShowForAll(Infoline2);
    }
    else if(line == 3)
    {
        format(string,sizeof(string),"%s",msg);
        TextDrawSetString(Infoline3,string);
        TextDrawShowForAll(Infoline3);
    }
    return 1;
}
Any help would be highly appreciated, thanks in advance!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)