14.08.2011, 03:55
Quote:
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.
|
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;
}