new string[128]; format(string,sizeof(string),"%s: {FFFFFF}%s", ReturnName(playerid), text); SendClientMessageToAll(GetPlayerColor(playerid), string);
Think it should cut automatically.
i actually tried it and it does ![]() Also there's no need for that code you have there it's useless. |
SendClientM(playerid, color, message[], length_1 = 100) // Credits for SickAttack (I think).
{
new length_2 = strlen(message);
if(length_2 <= length_1)
{
SendClientMessage(playerid, color, message);
}
else
{
new string[144], last_space, escape = floatround(length_1 / 1.2);
while(length_2 > length_1)
{
strcpy(string, message, 144);
for(new i = 0; i <= length_2; i ++)
{
if(message[i] == ' ' && i <= length_1)
{
last_space = i;
}
if(i > length_1)
{
i = length_2;
}
}
if(!last_space)
{
strdel(string, length_1, strlen(string));
strdel(message, 0, length_1);
length_2 -= length_1;
}
else if(last_space < escape)
{
strdel(string, escape, strlen(string));
strdel(message, 0, escape);
length_2 -= escape;
last_space = 0;
}
else
{
strdel(string, last_space, strlen(string));
strdel(message, 0, (last_space + 1));
length_2 -= last_space;
last_space = 0;
}
SendClientMessage(playerid, color, string);
if(length_2 < length_1)
{
SendClientMessage(playerid, color, message);
}
}
}
return 1;
}
PHP код:
|
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.
SendMessage(color, message[], length_1 = 100)
{
new length_2 = strlen(message);
if(length_2 <= length_1)
{
SendClientMessageToAll(color, message);
}
else
{
new string[144], last_space, escape = floatround(length_1 / 1.2);
while(length_2 > length_1)
{
strcpy(string, message, 144);
for(new i = 0; i <= length_2; i ++)
{
if(message[i] == ' ' && i <= length_1)
{
last_space = i;
}
if(i > length_1)
{
i = length_2;
}
}
if(!last_space)
{
strdel(string, length_1, strlen(string));
strdel(message, 0, length_1);
length_2 -= length_1;
}
else if(last_space < escape)
{
strdel(string, escape, strlen(string));
strdel(message, 0, escape);
length_2 -= escape;
last_space = 0;
}
else
{
strdel(string, last_space, strlen(string));
strdel(message, 0, (last_space + 1));
length_2 -= last_space;
last_space = 0;
}
SendClientMessageToAll(color, message);
if(length_2 < length_1)
{
SendClientMessageToAll(color, message);
}
}
}
return 1;
}
public OnPlayerText(playerid, text[])
{
SendMessage(-1, text); // Change -1 to any color you want.
return 0;
}
Ah you want it as SendClientMessageToAll;
PHP код:
PHP код:
|