Errors can I get a hand? - 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: Errors can I get a hand? (
/showthread.php?tid=351689)
Errors can I get a hand? -
kujox222 - 16.06.2012
Код:
(2108) : error 037: invalid string (possibly non-terminated string)
(2108) : error 017: undefined symbol "d"
(2108) : error 029: invalid expression, assumed zero
(2108) : fatal error 107: too many error messages on one line
Here is the line with the problem
Here is the whole code that its having the problem with.
Код:
public ShowStats(playerid,targetid)
{
new string[250],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string,sizeof(string),""embed_blue"%s "embed_white"stats\n\
"embed_blue"Money:"embed_white"$%d\n\
"embed_blue"Admin Level:"embed_white"%d\n\
pName,
pInfo[playerid][pMoney],
pInfo[playerid][AdminLevel],
ShowPlayerDialog(playerid,1234,DIALOG_STYLE_MSGBOX,""embed_white"Stats",string,"Ok","");
return 1;
}
Re: Errors can I get a hand? -
Face9000 - 16.06.2012
Re: Errors can I get a hand? -
kujox222 - 17.06.2012
Quote:
Originally Posted by Logitech90
|
Didn't fix it, still has the errors.
Код:
error 037: invalid string (possibly non-terminated string)
error 017: undefined symbol "d"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Re: Errors can I get a hand? -
Face9000 - 17.06.2012
That's because you wrong coded this part:
pawn Код:
format(string,sizeof(string),""embed_blue"%s "embed_white"stats\n\
"embed_blue"Money:"embed_white"$%d\n\
"embed_blue"Admin Level:"embed_white"%d\n\
pName,
pInfo[playerid][pMoney],
pInfo[playerid][AdminLevel],
The pInfo values should go after you add the %d.
Re: Errors can I get a hand? -
kujox222 - 17.06.2012
Quote:
Originally Posted by Logitech90
That's because you wrong coded this part:
pawn Код:
format(string,sizeof(string),""embed_blue"%s "embed_white"stats\n\ "embed_blue"Money:"embed_white"$%d\n\ "embed_blue"Admin Level:"embed_white"%d\n\ pName, pInfo[playerid][pMoney], pInfo[playerid][AdminLevel],
The pInfo values should go after you add the %d.
|
Isn't that what its doing?
Re: Errors can I get a hand? -
Ray0 - 17.06.2012
Код:
error 037: invalid string (possibly non-terminated string)
pawn Код:
format(string,sizeof(string),""embed_blue"%s "embed_white"stats\n\
"embed_blue"Money:"embed_white"$%d\n\
"embed_blue"Admin Level:"embed_white"%d\n\"
pName,
pInfo[playerid][pMoney],
pInfo[playerid][AdminLevel]);
You missed out a " before pName to terminate the string.
Re: Errors can I get a hand? -
kujox222 - 17.06.2012
Quote:
Originally Posted by Ray0
Код:
error 037: invalid string (possibly non-terminated string)
pawn Код:
format(string,sizeof(string),""embed_blue"%s "embed_white"stats\n\ "embed_blue"Money:"embed_white"$%d\n\ "embed_blue"Admin Level:"embed_white"%d\n\" pName, pInfo[playerid][pMoney], pInfo[playerid][AdminLevel]);
You missed out a " before pName to terminate the string.
|
Код:
"embed_blue"Admin Level:"embed_white"%d\n\"
It moved everything to this string now.