Another Help OnPlayerText
#10

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
I am hoping that someone could create and release something similar to what LS-RP has where it splits the text into multiple lines if you go over 128 characters.
I see my post was completely ignored, anyways look at this...

pawn Код:
#define MAX_CHARS_PER_LINE 80
#define FINAL_DOTS
stock sendLongMessage( playerid , color , message[] )
{
    new len = strlen(message),
        NumberOLines = len / MAX_CHARS_PERLineString;

    if( ( len % MAX_CHARS_PERLineString ) ) NumberOLines++;
    new LineString[MAX_CHARS_PERLineString + 5];

    new CurrentLine;
    while( CurrentLine < NumberOLines )
    {
        strmid( LineString, message, ( CurrentLine * MAX_CHARS_PER_LINE ), ( CurrentLine * MAX_CHARS_PER_LINE ) + MAX_CHARS_PER_LINE );
        ////////////
        #if defined FINAL_DOTS
        if( NumberOLines > 1 )
        {
            if( CurrentLine == 0 )
            {
                format( LineString, sizeof LineString, "%s ...", LineString );
            }
            else if( CurrentLine > 0 && ( CurrentLine + 1 ) < NumberOLines )
            {
                format( LineString, sizeof LineString, "... %s ...", LineString );
            }
            else
            {
                format( LineString, sizeof LineString, "... %s", LineString );
            }
        }
        #endif
        ////////////
        SendClientMessage( playerid, color, LineString );
        ///////////
        CurrentLine++;
    }
    return 1;
}
Reply


Messages In This Thread
Another Help OnPlayerText - by lyrics - 14.08.2011, 02:35
Re: Another Help OnPlayerText - by linuxthefish - 14.08.2011, 02:36
Re: Another Help OnPlayerText - by lyrics - 14.08.2011, 02:39
Re: Another Help OnPlayerText - by Kar - 14.08.2011, 02:42
Re: Another Help OnPlayerText - by linuxthefish - 14.08.2011, 02:42
Re: Another Help OnPlayerText - by lyrics - 14.08.2011, 02:45
Re: Another Help OnPlayerText - by linuxthefish - 14.08.2011, 02:47
Re: Another Help OnPlayerText - by lyrics - 14.08.2011, 02:56
Re: Another Help OnPlayerText - by Scenario - 14.08.2011, 03:00
Re: Another Help OnPlayerText - by Kar - 14.08.2011, 03:55

Forum Jump:


Users browsing this thread: 4 Guest(s)