Text length
#1

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.
Reply
#2

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 =].
Reply
#3

Thanks.. but i want to send the message to all
Reply
#4

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);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)