08.04.2014, 01:08
I can't see what I did wrong, i'm too tired to figure it out. But any string entered that is longer than 67 characters is supposed to split the string, anything shorter isn't. The short strings work, but it's doing the default thing for longer strings. (IE showing my color, and my FULL name, my script removes the "_")
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[150], string2[150];
if(strlen(text) > 68)
{
new texts[61];
strmid(texts, text, 68, 129);
strins(text, "-", 68, 1);
strdel(text, 69, 129);
format(string, sizeof(string), "%s says: %s", GetName(playerid), text);
format(string2, sizeof(string2), "%... %s", GetName(playerid), texts);
ProxDetector(10, playerid, string, 0xE6E6E6AA, 0xC8C8C8AA, 0xAAAAAAAA, 0x8C8C8CAA, 0x6E6E6EAA);
ProxDetector(10, playerid, string2, 0xE6E6E6AA, 0xC8C8C8AA, 0xAAAAAAAA, 0x8C8C8CAA, 0x6E6E6EAA);
print(string);
print(string2);
return 0;
}
else
{
format(string, sizeof(string), "%s says: %s", GetName(playerid), text);
ProxDetector(10, playerid, string, 0xE6E6E6AA, 0xC8C8C8AA, 0xAAAAAAAA, 0x8C8C8CAA, 0x6E6E6EAA);
print(string);
}
return 0;
}