Next line chat
#1

anyone know how to do the next line message. mines only 1 line


Код:
    new string[128];
    format(string,sizeof(string),"%s: {FFFFFF}%s", ReturnName(playerid), text);
    SendClientMessageToAll(GetPlayerColor(playerid), string);
Mine:



Try to make it like this:
Reply
#2

Think it should cut automatically.

i actually tried it and it does You're just not inputting enough characters to make it split.

Also there's no need for that code you have there it's useless.
Reply
#3

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
Think it should cut automatically.

i actually tried it and it does You're just not inputting enough characters to make it split.

Also there's no need for that code you have there it's useless.
Ok Thak you . i remove the code
Reply
#4

Check this http://forum.sa-mp.com/showpost.php?...87&postcount=2
Reply
#5

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
It show 2 times lines
Reply
#6

PHP код:
SendClientM(playeridcolormessage[], length_1 100// Credits for SickAttack (I think).
{
    new 
length_2 strlen(message);
    if(
length_2 <= length_1)
    {
        
SendClientMessage(playeridcolormessage);
    }
    else
    {
        new 
string[144], last_spaceescape floatround(length_1 1.2);
        while(
length_2 length_1)
        {
            
strcpy(stringmessage144);

            for(new 
0<= length_2++)
            {
                if(
message[i] == ' ' && <= length_1)
                {
                    
last_space i;
                }

                if(
length_1)
                {
                    
length_2;
                }
            }

            if(!
last_space)
            {
                
strdel(stringlength_1strlen(string));
                
strdel(message0length_1);

                
length_2 -= length_1;
            }
            else if(
last_space escape)
            {
                
strdel(stringescapestrlen(string));
                
strdel(message0escape);

                
length_2 -= escape;
                
last_space 0;
            }
            else 
            {
                
strdel(stringlast_spacestrlen(string));
                
strdel(message0, (last_space 1));

                
length_2 -= last_space;
                
last_space 0;
            }

            
SendClientMessage(playeridcolorstring);

            if(
length_2 length_1)
            {
                
SendClientMessage(playeridcolormessage);
            }
        }
    }
    return 
1;

Reply
#7

Quote:
Originally Posted by oMa37
Посмотреть сообщение
PHP код:
SendClientM(playeridcolormessage[], length_1 100// Credits for SickAttack (I think).
{
    new 
length_2 strlen(message);
    if(
length_2 <= length_1)
    {
        
SendClientMessage(playeridcolormessage);
    }
    else
    {
        new 
string[144], last_spaceescape floatround(length_1 1.2);
        while(
length_2 length_1)
        {
            
strcpy(stringmessage144);
            for(new 
0<= length_2++)
            {
                if(
message[i] == ' ' && <= length_1)
                {
                    
last_space i;
                }
                if(
length_1)
                {
                    
length_2;
                }
            }
            if(!
last_space)
            {
                
strdel(stringlength_1strlen(string));
                
strdel(message0length_1);
                
length_2 -= length_1;
            }
            else if(
last_space escape)
            {
                
strdel(stringescapestrlen(string));
                
strdel(message0escape);
                
length_2 -= escape;
                
last_space 0;
            }
            else 
            {
                
strdel(stringlast_spacestrlen(string));
                
strdel(message0, (last_space 1));
                
length_2 -= last_space;
                
last_space 0;
            }
            
SendClientMessage(playeridcolorstring);
            if(
length_2 length_1)
            {
                
SendClientMessage(playeridcolormessage);
            }
        }
    }
    return 
1;

Код:
public OnPlayerText(playerid, text[])
{
    SendClientM(text);
    return 0;
}
Код:
error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#8

Ah you want it as SendClientMessageToAll;

PHP код:
SendMessage(colormessage[], length_1 100)
{
    new 
length_2 strlen(message);
    if(
length_2 <= length_1)
    {
        
SendClientMessageToAll(colormessage);
    }
    else
    {
        new 
string[144], last_spaceescape floatround(length_1 1.2);
        while(
length_2 length_1)
        {
            
strcpy(stringmessage144);
            for(new 
0<= length_2++)
            {
                if(
message[i] == ' ' && <= length_1)
                {
                    
last_space i;
                }
                if(
length_1)
                {
                    
length_2;
                }
            }
            if(!
last_space)
            {
                
strdel(stringlength_1strlen(string));
                
strdel(message0length_1);
                
length_2 -= length_1;
            }
            else if(
last_space escape)
            {
                
strdel(stringescapestrlen(string));
                
strdel(message0escape);
                
length_2 -= escape;
                
last_space 0;
            }
            else 
            {
                
strdel(stringlast_spacestrlen(string));
                
strdel(message0, (last_space 1));
                
length_2 -= last_space;
                
last_space 0;
            }
            
SendClientMessageToAll(colormessage);
            if(
length_2 length_1)
            {
                
SendClientMessageToAll(colormessage);
            }
        }
    }
    return 
1;

Usage:

PHP код:
public OnPlayerText(playeridtext[])
{
    
SendMessage(-1text); // Change -1 to any color you want.
    
return 0;

Reply
#9

Quote:
Originally Posted by oMa37
Посмотреть сообщение
Ah you want it as SendClientMessageToAll;

PHP код:
SendMessage(colormessage[], length_1 100)
{
    new 
length_2 strlen(message);
    if(
length_2 <= length_1)
    {
        
SendClientMessageToAll(colormessage);
    }
    else
    {
        new 
string[144], last_spaceescape floatround(length_1 1.2);
        while(
length_2 length_1)
        {
            
strcpy(stringmessage144);
            for(new 
0<= length_2++)
            {
                if(
message[i] == ' ' && <= length_1)
                {
                    
last_space i;
                }
                if(
length_1)
                {
                    
length_2;
                }
            }
            if(!
last_space)
            {
                
strdel(stringlength_1strlen(string));
                
strdel(message0length_1);
                
length_2 -= length_1;
            }
            else if(
last_space escape)
            {
                
strdel(stringescapestrlen(string));
                
strdel(message0escape);
                
length_2 -= escape;
                
last_space 0;
            }
            else 
            {
                
strdel(stringlast_spacestrlen(string));
                
strdel(message0, (last_space 1));
                
length_2 -= last_space;
                
last_space 0;
            }
            
SendClientMessageToAll(colormessage);
            if(
length_2 length_1)
            {
                
SendClientMessageToAll(colormessage);
            }
        }
    }
    return 
1;

Usage:

PHP код:
public OnPlayerText(playeridtext[])
{
    
SendMessage(-1text); // Change -1 to any color you want.
    
return 0;

how can i add the player names? it should be like this https://sampforum.blast.hk/showthread.php?tid=628049


HELLO WORLD!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ... <<<<<<EXAMPLE 128 CHARACTERSS
then I want to continue it in 2nd line, so it will be something like
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)