Really thanks for advice :-)
I've just done this:
function OnCommand(ID: Byte; Text: string): boolean;
var
co, line1, line2: string;
i, medzera: integer;
begin
if Copy(Text, 0, 5) = '/text' then begin
co := Copy(Text, 7, Length(Text));
// If there's more than 38 chars => it has to be broken to 2 lines...
if Length(co) > 38 then begin
for i := 38 downto 1 do begin
if co[i] = ' ' then begin
medzera := i;
break;
end;
end;
line1 := Copy(co, 0, medzera-1);
line2 := Copy(co, medzera+1, Length(co));
co := line1 +chr(13)+chr(10) + line2;
DrawText(0, co, 330, RGB(255, 0, 255), 0.10, 15, 380);
end
// If it has less than 38 chars...
else begin
DrawText(0, co, 330, RGB(255, 0, 255), 0.10, 15, 400);
end;
end;
end;