SA-MP Forums Archive
make new line when text is to long? - 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: make new line when text is to long? (/showthread.php?tid=188635)



make new line when text is to long? - iJumbo - 08.11.2010

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


Re: make new line when text is to long? - Kwarde - 08.11.2010

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


Re: make new line when text is to long? - Scenario - 08.11.2010

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...


Re: make new line when text is to long? - Jaxson - 08.11.2010

Try with combining strlen and strid.


Re: make new line when text is to long? - BMUK - 08.11.2010

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



Re: make new line when text is to long? - MestreKiller - 21.12.2010

try \n