Split message
#1

I have a problem with this stock:

pawn Код:
#define EX_SPLITLENGTH 150
stock SendSplitMessageToAll(color, const final[])
{
    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);
            }
            SCMTA(color, buffer);
        }
    }
    else
    {
        SCMTA(color, final);
    }
    return 1;
}
OnPlayerText:

pawn Код:
new j[230];
    format(j,sizeof j,"{%06x} %s: "WHITE"%s ", GetPlayerColor(playerid) >>> 8, ReturnName(playerid, 0), text);
    SendSplitMessageToAll(-1, j);
If i type, ex: test test test test test test test test test test test test test test test test test test test test (more than 150 chars), it sends just the last 3 words of the text, without playernick/color, why?
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=622844
Reply
#3

Didn't know about this, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)