Two lined text strings? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Two lined text strings? (
/showthread.php?tid=455350)
Two lined text strings? -
Ceez - 01.08.2013
Hey,
I was trying to make a LS-RP-like 2 lined /me and /do, texts, etc, however.. I managed to make it two lined but i find it impossible to keep writing until it wont let you write anymore - like block you, in the input and then it'll cut a few words from the output (whats displayed on the screen.)
I checked out every single topic and I couldnt figure out how this goes.
pawn Код:
#define EX_SPLITLENGTH 85
stock SendMeMessage(playerid, color, final[])
{
#pragma unused playerid, color
new buffer[EX_SPLITLENGTH+5];
new len = strlen(final);
if(len>EX_SPLITLENGTH)
{
new times = (len/EX_SPLITLENGTH);
for(new i = 0; i < times+1; i++)
{
strdel(buffer, 0, EX_SPLITLENGTH+5);
if(len-(i*EX_SPLITLENGTH)>EX_SPLITLENGTH)
{
strmid(buffer, final, EX_SPLITLENGTH*i, EX_SPLITLENGTH*(i+1));
format(buffer, sizeof(buffer), "%s ..-", buffer);
}
else
{
strmid(buffer, final, EX_SPLITLENGTH*i, len);
}
SendClientMessage(playerid, color, buffer);
}
}
else
{
SendClientMessage(playerid, color, final);
}
}
However, anybody have any idea how to make something fimiliar to this but that will actually work well?