Chat Multi lines
#1

I try to create chat multi lines for RP server, but still don't work and got bug when /do, /me

there is my code anyone can help me pls ! thanks you

PHP код:
CMD:do(playeridparams)
{
if(
strlen(params) < 100)
    {
        new 
string[128];
        
format(stringsizeof(string), "* %s (( %s ))"paramsGetPlayerNameEx(playerid));
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else
    {
        new 
str[128], string[128];
        
strmid(str,(params),100,200);
        
strins((params), "-..."1001);
        
strdel((params), 101200);
        
format(stringsizeof(string), "* %s (( %s ))"paramsGetPlayerNameEx(playerid));
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
format(strsizeof(str), "* %s (( %s ))"paramsGetPlayerNameEx(playerid));
        
ProxDetector(30.0playeridstrCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }

Reply
#2

Try theses function:
pawn Код:
stock SendMultilineMessage(playerid, color, msg[])
{
    if(strlen(msg) > 100)
    {
        new pos;
        for(;;)
        {
            new text[101];
            strmid(text, msg, 0, 100);
            strdel(msg, 0, 100);
            SendClientMessage(playerid, color, text);
           
            if(strlen(msg) < 100 && strlen(msg) != 0)
            {
                SendClientMessage(playerid, color, msg);
                return 1;
            }
        }
    }
    else {
        return SendClientMessage(playerid, color, msg);
    }
}
Not tested... Dunno if it'll work...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)