I try to create chat multi lines for RP server, but still don't work and got bug when /do, /me
PHP код:
CMD:do(playerid, params)
{
if(strlen(params) < 100)
{
new string[128];
format(string, sizeof(string), "* %s (( %s ))", params, GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
new str[128], string[128];
strmid(str,(params),100,200);
strins((params), "-...", 100, 1);
strdel((params), 101, 200);
format(string, sizeof(string), "* %s (( %s ))", params, GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(str, sizeof(str), "* %s (( %s ))", params, GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, str, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
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...