SA-MP Forums Archive
Input line too long - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Input line too long (/showthread.php?tid=406811)



Input line too long - NicholasA - 11.01.2013

Hey guys in my script it says that the line is too long, how do i fix this, line:
pawn Код:
case 8 : ShowPlayerDialog( playerid, 3443, DIALOG_STYLE_LIST, "{AA3333}Saloons", "{B8860B}Admiral\n{B8860B}Bloodring Banger\n{B8860B}Bravura\n{B8860B}Buccaneer\n{B8860B}Cadrona\n{B8860B}Clover\n{B8860B}Elegant\n{B8860B}Elegy\n{B8860B}Emperor\n{B8860B}Esperanto\n{B8860B}Fortune\n{B8860B}Broken Glendale\n{B8860B}Glendale\n{B8860B}Greenwood\n{B8860B}Hermes\n{B8860B}Intruder\n{B8860B}Majestic\n{B8860B}Manana\n{B8860B}Merit\n{B8860B}Nebula\n{B8860B}Oceanic\n{B8860B}Picador\n{B8860B}Premier\n{B8860B}Previon\n{B8860B}Primo\n{B8860B}Sentinel\n{B8860B}Stafford\n{B8860B}Sultan\n{B8860B}Sunrise\n{B8860B}Tampa\n{B8860B}Vincent\n{B8860B}Virgo\n{B8860B}Willard\n{B8860B}Washington\nBack", "Select", "Cancel" );



Re: Input line too long - NeroX98 - 11.01.2013

Wow that is too long man

Use strings

Example:
pawn Код:
new string[126];
new string1[126];
new string2[364];
format(string, sizeof(string), "Option 1\nOption 2");
format(string1, sizeof(string1), "Option 3\nOption 4");
format(string2, sizeof(string2), "%s%s", string, string1);
ShowPlayerDialog( playerid, 3443, DIALOG_STYLE_LIST, "{AA3333}Saloons", string2, "Select", "Cancel" );



Re: Input line too long - NicholasA - 11.01.2013

How do strings work?


Re: Input line too long - NeroX98 - 11.01.2013

pawn Код:
case 8 :

new string[264];
new string1[264];
new string2[264];
new string3[864];
format(string, sizeof(string), "{B8860B}Admiral\n{B8860B}Bloodring Banger\n{B8860B}Bravura\n{B8860B}Buccaneer\n{B8860B}Cadrona\n{B8860B}Clover\n{B8860B}Elegant\n{B8860B}Elegy\n{B8860B}Emperor\n{B8860B}Esperanto\n{B8860B}Fortune\n{B8860B}Broken Glendale\n");
format(string1, sizeof(string1), "{B8860B}Glendale\n{B8860B}Greenwood\n{B8860B}Hermes\n{B8860B}Intruder\n{B8860B}Majestic\n{B8860B}Manana\n{B8860B}Merit\n{B8860B}Nebula\n{B8860B}Oceanic\n{B8860B}Picador\n{B8860B}Premier\n{B8860B}Previon\n");
format(string2, sizeof(string2), "{B8860B}Primo\n{B8860B}Sentinel\n{B8860B}Stafford\n{B8860B}Sultan\n{B8860B}Sunrise\n{B8860B}Tampa\n{B8860B}Vincent\n{B8860B}Virgo\n{B8860B}Willard\n{B8860B}Washington\nBack");
format(string3, sizeof(string3), "%s%s%s",string,string1,string2);
ShowPlayerDialog( playerid, 3443, DIALOG_STYLE_LIST, "{AA3333}Saloons", string3, "Select", "Cancel" );
If you get the same error try to add another string