SA-MP Forums Archive
Split message - 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)
+--- Thread: Split message (/showthread.php?tid=658425)



Split message - KinderClans - 03.09.2018

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?


Re: Split message - RogueDrifter - 03.09.2018

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


Re: Split message - KinderClans - 03.09.2018

Didn't know about this, thank you.