Text length - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Text length (
/showthread.php?tid=130748)
Text length -
deather - 28.02.2010
How to limit a line's text?
Like i have a message and i want only 25 characters to be in the first line and if its above 25 it must move on to the next line.
Re: Text length -
[HiC]TheKiller - 28.02.2010
pawn Код:
stock SendClientMessageEx(playerid, Color, Message[], Interval)
{
new Len = strlen(Message);
while(strlen(Message) > Inverval)
{
new Str[256];
strmid(Str, Message, 0, Interval);
SendClientMessage(playerid, Color, Str);
strdel(Message, 0, Interval);
}
if(strlen(Message) > 1) return SendClientMessage(player, Color, Message);
}
(Not tested). Change interval to 25 =].
Re: Text length -
deather - 28.02.2010
Thanks.. but i want to send the message to all
Re: Text length -
[HiC]TheKiller - 28.02.2010
pawn Код:
stock SendClientMessageToAllEx(Color, Message[], Interval)
{
new Len = strlen(Message);
while(strlen(Message) > Inverval)
{
new Str[256];
strmid(Str, Message, 0, Interval);
SendClientMessageToAll(Color, Str);
strdel(Message, 0, Interval);
}
if(strlen(Message) > 1) return SendClientMessageToAll(Color, Message);
}