String too big = no text
#2

You can use this function.

pawn Код:
SendSplittedMessage(playerid, color, const msg[], maxlen)
{
    new firstpos, lastpos;
    new part[128];
    new count = 1;
    new length = strlen(msg);
    for(new p=0; p < length; p++)
    {
        if(msg[p] == ' ')
        {
            lastpos = p;
        }
        if(p == length-1)
        {
            lastpos = length;
        }
        if(p >= count*maxlen || p == length-1)
        {
            if(lastpos == firstpos) { lastpos = count*maxlen; }
            strmid(part, msg, firstpos, lastpos, 128);
            firstpos = lastpos;
            count++;
            SendClientMessage(playerid, color, part);
        }
    }
}
Reply


Messages In This Thread
String too big = no text - by MafiaGuy™ - 04.06.2010, 13:35
Re: String too big = no text - by MadeMan - 04.06.2010, 13:50

Forum Jump:


Users browsing this thread: 1 Guest(s)