SA-MP Forums Archive
Another line - 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: Another line (/showthread.php?tid=430873)



Another line - RelatedC - 15.04.2013

I just came to ask if there is any option to expend the words limit in the chat, or just keept text in a new line.
Example:
Quote:

Marco_Smith says : sadfklasdfklsdafldskflskafladkfdlskflskfksldfkasld fksflsfkskflsfdkldsflsdfklsdafdl...
Marco_Smith says: ... asdfalksflsakfkdsflsafdksfaklsdafkasdflsdfak.




Re: Another line - [XST]O_x - 15.04.2013

pawn Код:
#include <a_samp>

#define MAX_LENGTH_CHAT 50

public OnPlayerText(playerid, text[])
{
    new tmpdest[128], finalmsg[50];
    if(strlen(text) >= MAX_LENGTH_CHAT)
    {
        strmid(tmpdest, text, 0, MAX_LENGTH_CHAT-3);
        format(finalmsg, MAX_LENGTH_CHAT, "%s...", tmpdest);
        SendPlayerMessageToAll(playerid, finalmsg);
        strmid(tmpdest, text, MAX_LENGTH_CHAT-3, strlen(text));
        format(finalmsg, MAX_LENGTH_CHAT,"...%s", tmpdest);
        SendPlayerMessageToAll(playerid, finalmsg);
    }
    return 1;
}
Untested.