28.02.2017, 23:39
(
Последний раз редактировалось danielpalade; 25.09.2017 в 21:58.
)
-- DELETED --
That's called splitting, check http://forum.sa-mp.com/showpost.php?...26&postcount=3
|
SendCompressedMessage ( reciever, col, text [] ) {
new compressedText [ 256 ];
format ( compressedText, sizeof( compressedText), "%s", text);
if ( strlen ( compressedText ) > 75 ) {
new cutText [ 120 ];
strmid(cutText, compressedText, 0, 74);
strdel(compressedText, 0, 74);
strins(cutText, " ...", strlen ( cutText)) ;
strins(compressedText, "... ", 0) ;
SendClientMessage ( reciever, col, cutText);
SendClientMessage ( reciever, col, compressedText);
}
else SendClientMessage ( reciever, col, text );
return true ;
}
CMD:me ( playerid, params [] ) {
static text [ 144 ], string [ 256 ];
if ( sscanf ( params, "s[144]", text ) ) {
return SendClientMessage(playerid, 0x11A5D6FF, "* Syntax:{dedede} /me [text]");
}
format ( string, sizeof ( string ), "* %s %s",ReturnUserName ( playerid, false ), text );
SendCompressedMessage ( playerid, CHAT_COLOUR_ACTION, string );
return true;
}
You need to process the text, check for length and then split it accordingly.
Here's an outdated version of the function I used. It works, but you need to format text and then use this function to send the message (in order to support text splitting). You can use up the entire chat bar (until it won't let you go further) and it will parse all of the text. pawn Код:
pawn Код:
|