Errors! help needed "input line too long" -
Anak - 17.06.2013
hello guys

i have made this
pawn Код:
new string[340], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{FFFFFF}* Account information for nick '{00FF00}%s{FFFFFF}' are following:\n\n1). Account Password: {FF0000}Not Available (Disabled By Staff){FFFFFF}\n2). Admin Level: '{00FF00}%d{FFFFFF}'\n3). Vip Level: '{00FF00}%d{FFFFFF}'\n4). Money: '{00FF00}$%d{FFFFFF}'\n5). Score: '{00FF00}%d{FFFFFF}'\n6). Kills: '{00FF00}%d{FFFFFF}'\n7). Death: '{00FF00}%d{FFFFFF}'", pname , pInfo[playerid][Adminlevel], pInfo[playerid][VIPlevel], pInfo[playerid][Money], pInfo[playerid][Scores], pInfo[playerid][Kills], pInfo[playerid][Deaths]);
ShowPlayerDialog(playerid, account_info, DIALOG_STYLE_MSGBOX, "{00FF00}Account Info", string,"Close","");
// ^ line 53
and i'm getting these errors:
Код:
D:\eXtreme_Free-Roam_2013\FR 2013\filterscripts\project.pwn(551) : error 075: input line too long (after substitutions)
D:\eXtreme_Free-Roam_2013\FR 2013\filterscripts\project.pwn(552) : error 017: undefined symbol "playeri"
D:\eXtreme_Free-Roam_2013\FR 2013\filterscripts\project.pwn(553) : warning 217: loose indentation
D:\eXtreme_Free-Roam_2013\FR 2013\filterscripts\project.pwn(553) : error 017: undefined symbol "d"
D:\eXtreme_Free-Roam_2013\FR 2013\filterscripts\project.pwn(553) : error 029: invalid expression, assumed zero
D:\eXtreme_Free-Roam_2013\FR 2013\filterscripts\project.pwn(553) : error 029: invalid expression, assumed zero
D:\eXtreme_Free-Roam_2013\FR 2013\filterscripts\project.pwn(553) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
6 Errors.
thanks for your help

+1
Re: Errors! help needed "input line too long" -
IceBilizard - 17.06.2013
the line 553 is this line?
pawn Код:
ShowPlayerDialog(playerid, account_info, DIALOG_STYLE_MSGBOX, "{00FF00}Account Info", string,"Close","");
Re: Errors! help needed "input line too long" -
Jeffry - 17.06.2013
As the error says, the input in your code is too long.
Simply split up the format:
pawn Код:
new string[512], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{FFFFFF}* Account information for nick '{00FF00}%s{FFFFFF}' are following:\n\n1). Account Password: {FF0000}Not Available (Disabled By Staff){FFFFFF}\n", pname);
format(string, sizeof(string), "%s2). Admin Level: '{00FF00}%d{FFFFFF}'\n3). Vip Level: '{00FF00}%d{FFFFFF}'\n4). Money: '{00FF00}$%d{FFFFFF}'\n", string, pInfo[playerid][Adminlevel], pInfo[playerid][VIPlevel], pInfo[playerid][Money]);
format(string, sizeof(string), "%s5). Score: '{00FF00}%d{FFFFFF}'\n6). Kills: '{00FF00}%d{FFFFFF}'\n7). Deaths: '{00FF00}%d{FFFFFF}'", string, pInfo[playerid][Scores], pInfo[playerid][Kills], pInfo[playerid][Deaths]);
ShowPlayerDialog(playerid, account_info, DIALOG_STYLE_MSGBOX, "{00FF00}Account Info", string,"Close","");
AW: Re: Errors! help needed "input line too long" -
HurtLocker - 17.06.2013
Quote:
Originally Posted by Jeffry
As the error says, the input in your code is too long.
Simply split up the format:
pawn Код:
new string[512], pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), "{FFFFFF}* Account information for nick '{00FF00}%s{FFFFFF}' are following:\n\n1). Account Password: {FF0000}Not Available (Disabled By Staff){FFFFFF}\n", pname); format(string, sizeof(string), "%s2). Admin Level: '{00FF00}%d{FFFFFF}'\n3). Vip Level: '{00FF00}%d{FFFFFF}'\n4). Money: '{00FF00}$%d{FFFFFF}'\n", string, pInfo[playerid][Adminlevel], pInfo[playerid][VIPlevel], pInfo[playerid][Money]); format(string, sizeof(string), "%s5). Score: '{00FF00}%d{FFFFFF}'\n6). Kills: '{00FF00}%d{FFFFFF}'\n7). Deaths: '{00FF00}%d{FFFFFF}'", string, pInfo[playerid][Scores], pInfo[playerid][Kills], pInfo[playerid][Deaths]); ShowPlayerDialog(playerid, account_info, DIALOG_STYLE_MSGBOX, "{00FF00}Account Info", string,"Close","");
|
This will not work. The string variable will have the last formated string as value.
You must use
https://sampwiki.blast.hk/wiki/Strcat to make a huge formated string.
Re: AW: Re: Errors! help needed "input line too long" -
Jeffry - 17.06.2013
Quote:
Originally Posted by HurtLocker
|
Wrong. Try it, and let yourself be convinced. I always do it like this, and I have never used strcat. I don't see a reason why this should not work. The old string gets set to the beginning of the new string. Simple as that.
AW: Errors! help needed "input line too long" -
HurtLocker - 17.06.2013
If you say that it works then it works, i didn't know of this. But i remember months ago, when i tried to create a big string and got errors, i asked for help and i was given the strcat thing. And it works too.
Re: AW: Errors! help needed "input line too long" -
Jeffry - 17.06.2013
Quote:
Originally Posted by HurtLocker
If you say that it works then it works, i didn't know of this. But i remember months ago, when i tried to create a big string and got errors, i asked for help and i was given the strcat thing. And it works too.
|
Absolutely, strcat also works. Yet, I think this way is much better and gives you a better overview of the code, especially when you have 20+ lines of these.
Re: Errors! help needed "input line too long" -
ReVo_ - 17.06.2013
His code should work ok, but format is slow.
Just to give a chance to the compiler:
Have you tried to "split" string using \ ?
"Hello \
World"
then format or strcat is ok.
https://sampwiki.blast.hk/wiki/Format
https://sampwiki.blast.hk/wiki/Strcat
Re: Errors! help needed "input line too long" -
Jeffry - 17.06.2013
Quote:
Originally Posted by ReVo_
His code should work ok, but format is slow.
|
Well, "slow". I think it doesn't really matter if the code takes 0.00012451 sec or 0.00012450 sec (Random numbers, but could match).
It might become a problem at this:
Quote:
Originally Posted by ReVo_
Just to give a chance to the compiler:
Have you tried to "split" string using \ ?
"Hello \
World"
|
Yes, this is also a possibility. I personally don't like it, because when you use many variables, you have them all in the end in a huge block. Personal preferences.
I guess you got enough ways to fix it now, choose the one you like the most, you're the scripter.
Re: Errors! help needed "input line too long" -
ReVo_ - 17.06.2013
Beh, if i should choose i prefer 0.00012450 ms.
Every ms is important for me.. Maybe with your example you can ignore the difference, but in the code you call 3 times format and I doubt that I would write that code without hesitation..