Client Message Appear Truncated
#4

Use this instead of SendClientMessage and increase your array size.

pawn Код:
#define MAX_CHARS_PER_LINE (80)
// Max characters per line.
#define FINAL_DOTS
// Remove it if you don't want dots for new lines.

stock BigMessage(playerid, colr, message[])
{
    new len = strlen(message),
        _iL = len / MAX_CHARS_PER_LINE;

    if( ( len % MAX_CHARS_PER_LINE ) ) _iL++;
    new _Line[MAX_CHARS_PER_LINE + 5];

    new _:_i@Index;
    while( _i@Index < _iL )
    {
        if( _i@Index == 0 )
            strmid( _Line, message, ( _i@Index * MAX_CHARS_PER_LINE ), ( _i@Index * MAX_CHARS_PER_LINE ) + MAX_CHARS_PER_LINE );
        else
            strmid( _Line, message, ( _i@Index * MAX_CHARS_PER_LINE ), ( _i@Index * MAX_CHARS_PER_LINE ) + MAX_CHARS_PER_LINE );

        #if defined FINAL_DOTS
        if( _iL > 1 )
        {
            if( _i@Index == 0 )
            {
                format( _Line, sizeof _Line, "%s ...", _Line );
            }
            else if( _i@Index > 0 && ( _i@Index + 1 ) < _iL )
            {
                format( _Line, sizeof _Line, "... %s ...", _Line );
            }
            else
            {
                format( _Line, sizeof _Line, "... %s", _Line );
            }
        }
        #endif
        ////////////
        SendClientMessage(playerid, colr, _Line );
        ///////////
        _i@Index++;
    }
}
Reply


Messages In This Thread
Client Message Appear Truncated - by ReDevilGames - 15.02.2013, 21:56
Re: Client Message Appear Truncated - by zxc1 - 16.02.2013, 00:02
Re: Client Message Appear Truncated - by RajatPawar - 16.02.2013, 02:47
Re: Client Message Appear Truncated - by T0pAz - 16.02.2013, 02:52
Re: Client Message Appear Truncated - by Luis- - 16.02.2013, 02:52

Forum Jump:


Users browsing this thread: 1 Guest(s)