What is the solution for the long line ? -
AnonScripter - 25.05.2014
I got long line error, how to fix it if the error is in a Message Text line ?
pawn Код:
List[playerid] = TextDrawCreate(171.875000, 175.583374, "- dsajklasd mdsal;ds kl;sald ndsladls;akdl jkdjsalkjdksajdkjaskdjskajdlksajdlksa ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa.");
Код:
(8089) : error 075: input line too long (after substitutions)
Re: What is the solution for the long line ? -
TazmaNiax - 25.05.2014
LOL, its to long Textdraw,, i should use
strcat
AW: What is the solution for the long line ? -
Nero_3D - 25.05.2014
Just put it in a seperate line, you can only get these error if the line is over ~500 char long
Re: What is the solution for the long line ? -
Corekt - 25.05.2014
You can break the line after each comma, and/or within the string itself using a backslash (\):
pawn Код:
List[playerid] = TextDrawCreate(171.875000, 175.583374,
"- dsajklasd mdsal;ds kl;sald ndsladls;akdl jkdjsalkjdksajdkjaskdjskajdlksajdlksa \
ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa.");
If the string is still too long, separate them into different parts then join them using strcat.
Re: What is the solution for the long line ? -
TazmaNiax - 25.05.2014
Or make per part
Re: What is the solution for the long line ? -
AnonScripter - 25.05.2014
i know what is the meaning of the error, but is there any solution ? or should i make a new variable called "List2[MAX_PLAYERS]" and continue the text here ?
Re: What is the solution for the long line ? -
TazmaNiax - 25.05.2014
yes, there any solution of your problem
*MyBadEnglish
Re: What is the solution for the long line ? -
AnonScripter - 25.05.2014
Quote:
Originally Posted by Corekt
You can break the line after each comma, and/or within the string itself using a backslash (\):
pawn Код:
List[playerid] = TextDrawCreate(171.875000, 175.583374, "- dsajklasd mdsal;ds kl;sald ndsladls;akdl jkdjsalkjdksajdkjaskdjskajdlksajdlksa \ ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa.");
|
Error turns to >>
Код:
(8089 -- 8090) : error 075: input line too long (after substitutions)
Quote:
Originally Posted by Corekt
If the string is still too long, separate them into different parts then join them using strcat.
|
can you please explain more ?
Re: What is the solution for the long line ? -
Corekt - 25.05.2014
In that case, divide your string into separate parts then concatenate them together like this. Since the final string won't change in your case, I would suggest making the array the exact length of your string + 1 to avoid wasting unnecessary space (in this case 154).
pawn Код:
new string[154] = "- dsajklasd mdsal;ds kl;sald ndsladls;akdl jkdjsalkjdksajdkjaskdjskajdlksajdlksa";
strcat(string, " ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa.");
List[playerid] = TextDrawCreate(171.875000, 175.583374, string);
https://sampwiki.blast.hk/wiki/Strcat
EDIT: Unless you intend to use a global textdraw (which in that case there's no need for the array), you should be using player textdraws for your player array. Switch to
CreatePlayerTextDraw.
Re: What is the solution for the long line ? -
AnonScripter - 25.05.2014
can i make this also if the text still long ?
pawn Код:
new string[154] = "- dsajklasd mdsal;ds kl;sald ndsladls;akdl jkdjsalkjdksajdkjaskdjskajdlksajdlksa";
strcat(string, " ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa.");
strcat(string, " ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa.");