make new line when text is to long?
#1

hey how to make a new line when client message text is to long ? i mean in automatic if the message exceeds a length of 50 words automatically make new line
Reply
#2

Maybe I know it.
I'll try to make it, and I'll send the script IF it's gonna work.
p.s., this already exists, a script like this, but I can't find it anymore :/

[EDIT]
Sorry, it didn't work :P And I don't have much time, so wait for someone else's reaction :P
Reply
#3

I brought this up awhile back, but nobody gave me an example and I am not sure how to do it. I'll see if I can try doing it though...
Reply
#4

Try with combining strlen and strid.
Reply
#5

This is just something I done, I think that the overflow string will appear BEFORE the actual text like so:

BMUK: awsome
BMUK: I love sa-mp and I think that it is freaking

.. :/

You can work off this as its a basic example

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strlen(text) > 50)
    {
        new overflow[59];
       
        strmid(overflow,text,50,strlen(text));
       
        strdel(text, 50,strlen(text));
       
        new string[80], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));

        format(string, sizeof(string), "%s: %s", name, overflow);
        SendPlayerMessageToAll(playerid,string);   
    }


   
    return 1;
}
Reply
#6

try \n
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)