Two lined text strings?
#1

Hey,
I was trying to make a LS-RP-like 2 lined /me and /do, texts, etc, however.. I managed to make it two lined but i find it impossible to keep writing until it wont let you write anymore - like block you, in the input and then it'll cut a few words from the output (whats displayed on the screen.)
I checked out every single topic and I couldnt figure out how this goes.
pawn Код:
#define EX_SPLITLENGTH 85

stock SendMeMessage(playerid, color, final[])
{
    #pragma unused playerid, color
    new buffer[EX_SPLITLENGTH+5];
    new len = strlen(final);
    if(len>EX_SPLITLENGTH)
    {
        new times = (len/EX_SPLITLENGTH);
        for(new i = 0; i < times+1; i++)
        {
            strdel(buffer, 0, EX_SPLITLENGTH+5);
            if(len-(i*EX_SPLITLENGTH)>EX_SPLITLENGTH)
            {
                strmid(buffer, final, EX_SPLITLENGTH*i, EX_SPLITLENGTH*(i+1));
                format(buffer, sizeof(buffer), "%s ..-", buffer);
            }
            else
            {
                strmid(buffer, final, EX_SPLITLENGTH*i, len);
            }
            SendClientMessage(playerid, color, buffer);
        }
    }
    else
    {
        SendClientMessage(playerid, color, final);
    }
}
However, anybody have any idea how to make something fimiliar to this but that will actually work well?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)