SA-MP Forums Archive
Problem with a long string. - 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: Problem with a long string. (/showthread.php?tid=502666)



Problem with a long string. - printer - 25.03.2014

pawn Код:
format(str2,sizeof(str2),"{007265}Faction Edit - {b7ba00}%s",inputtext);
            format(str3,sizeof(str3),"{007265}FACTION INFORMATION", "
            {007265} Please review the faction's information so far before continuing:\n
            {b7ba00} FACTION NAME: {ffffff}%s\n
            {b7ba00}FACTION TYPE: {ffffff}%s\n
            {b7ba00}FACTION DEFAULT SKIN: {ffffff}%i\n
            {b7ba00}FACTION RANKS:\n
            {b7ba00}1. %s\n
            {b7ba00}2. %s\n
            {b7ba00}3. %s\n
            {b7ba00}4. %s\n
            {b7ba00}5. %s\n
            {b7ba00}6. %s\n
            {b7ba00}7. %s\n
            {b7ba00}8. %s\n
            {b7ba00}9. %s\n
            {b7ba00}10. %s\n
            {b7ba00}11. %s\n
            {b7ba00}12. %s\n
            {b7ba00}13. %s\n
            {b7ba00}14. %s\n
            {b7ba00}15. %s\n"
, "Continue Editing", "Cancel", inputtext,fInfo[f_mysql_entry][fType],fInfo[f_mysql_entry][fType],fInfo[f_mysql_entry][fDefaultSkin],
            FactionRank[f_mysql_entry][0],FactionRank[f_mysql_entry][1],FactionRank[f_mysql_entry][2],FactionRank[f_mysql_entry][3],FactionRank[f_mysql_entry][4],FactionRank[f_mysql_entry][5],FactionRank[f_mysql_entry][6],
            FactionRank[f_mysql_entry][7],FactionRank[f_mysql_entry][8],FactionRank[f_mysql_entry][9],FactionRank[f_mysql_entry][10],FactionRank[f_mysql_entry][11],FactionRank[f_mysql_entry][12],FactionRank[f_mysql_entry][13],FactionRank[f_mysql_entry][14]);
The errors I get are something to do with the coloring, not sure:

pawn Код:
rp.pwn(1786) : error 037: invalid string (possibly non-terminated string)
rp.pwn(1787) : warning 215: expression has no effect
rp.pwn(1787) : error 001: expected token: ";", but found "}"
rp.pwn(1787) : warning 217: loose indentation
rp.pwn(1787) : error 017: undefined symbol "Please"
rp.pwn(1787) : error 017: undefined symbol "review"
rp.pwn(1787) : fatal error 107: too many error messages on one line



Re: Problem with a long string. - newbienoob - 25.03.2014

add blackslash ( \ ) everytime you want to use a new line in pawn
format(str3,sizeof(str3),"{007265}FACTION INFORMATION", "\
{007265} Please review the faction's information so far before continuing:\n\
...


Re: Problem with a long string. - printer - 25.03.2014

pawn Код:
format(str3,sizeof(str3),"{007265}FACTION INFORMATION","{007265}Please review the faction's information so far before continuing: \n\
            {b7ba00} FACTION NAME: {ffffff}%s  \n\
            {b7ba00}FACTION TYPE: {ffffff}%s  \n\
            {b7ba00}FACTION DEFAULT SKIN: {ffffff}%i  \n\
            {b7ba00}FACTION RANKS:  \n\
            {b7ba00}1. %s \n\
            {b7ba00}2. %s \n\
            {b7ba00}3. %s \n\
            {b7ba00}4. %s \n\
            {b7ba00}5. %s \n\
            {b7ba00}6. %s \n\
            {b7ba00}7. %s \n\
            {b7ba00}8. %s \n\
            {b7ba00}9. %s \n\
            {b7ba00}10. %s \n\
            {b7ba00}11. %s \n\
            {b7ba00}12. %s \n\
            {b7ba00}13. %s \n\
            {b7ba00}14. %s \n\
            {b7ba00}15. %s \n\", "
Continue Editing", "Cancel", inputtext,fInfo[f_mysql_entry][fType],fInfo[f_mysql_entry][fType],fInfo[f_mysql_entry][fDefaultSkin],
            FactionRank[f_mysql_entry][0],FactionRank[f_mysql_entry][1],FactionRank[f_mysql_entry][2],FactionRank[f_mysql_entry][3],FactionRank[f_mysql_entry][4],FactionRank[f_mysql_entry][5],FactionRank[f_mysql_entry][6],
            FactionRank[f_mysql_entry][7],FactionRank[f_mysql_entry][8],FactionRank[f_mysql_entry][9],FactionRank[f_mysql_entry][10],FactionRank[f_mysql_entry][11],FactionRank[f_mysql_entry][12],FactionRank[f_mysql_entry][13],FactionRank[f_mysql_entry][14]);
Still displays errors:
pawn Код:
rp.pwn(1802) : error 075: input line too long (after substitutions)
rp.pwn(1803) : error 037: invalid string (possibly non-terminated string)
rp.pwn(1803) : warning 215: expression has no effect
rp.pwn(1803) : error 001: expected token: ";", but found "}"
rp.pwn(1803) : warning 217: loose indentation
rp.pwn(1803) : error 017: undefined symbol "Please"
rp.pwn(1803) : fatal error 107: too many error messages on one line



Re: Problem with a long string. - newbienoob - 25.03.2014

use strcat or remove unnecessary code like color ({b7ba00})


Re: Problem with a long string. - printer - 25.03.2014

But I want it colorized.


Re: Problem with a long string. - newbienoob - 25.03.2014

then use strcat


Re: Problem with a long string. - printer - 25.03.2014

How..? can you give me an example in my code?


Re: Problem with a long string. - ]Rafaellos[ - 25.03.2014

Remove the colour from the
pawn Код:
{b7ba00}1. %s \n\
{b7ba00}2. %s \n\
{b7ba00}3. %s \n\
{b7ba00}4. %s \n\
{b7ba00}5. %s \n\
{b7ba00}6. %s \n\
{b7ba00}7. %s \n\
{b7ba00}8. %s \n\
{b7ba00}9. %s \n\
{b7ba00}10. %s \n\
{b7ba00}11. %s \n\
{b7ba00}12. %s \n\
{b7ba00}13. %s \n\
{b7ba00}14. %s \n\
{b7ba00}15. %s \n
Text colour will change again after FACTION RANKS: and it will remain the same untill the end. So basicly you colour with the same colour again and again.