sscanf problem... - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: sscanf problem... (
/showthread.php?tid=166824)
sscanf problem... -
DiddyBop - 10.08.2010
Everything is fine, except the last 3...
pawn Код:
new row[500];
mysql_fetch_row(row);
new Info[13], Info2[8][100];
sscanf(row, "p<|>ds[100]s[100]ddddddds[100]dds[100]ds[100]ddd", Info[0],
Info2[0], Info2[1], Info[1], Info[2], Info[3], Info[4], Info[5], Info[6], Info[7],
Info2[2], Info2[3], Info2[4], Info2[5], Info[8], Info2[6], Info[9], Info[10], Info[11], Info[12]);
SetPVarInt(playerid, "adminlvl", Info[2]);
SetPlayerScore(playerid, Info[7]); //Works
ResetPlayerSP(playerid);
ResetPlayerEXP(playerid);
GivePlayerEXP(playerid, Info[11]); //No worky
GivePlayerSP(playerid, Info[6]); //Works
SetPlayerScore(playerid, Info[6]); //Works
SetPlayerSkin(playerid, Info[10]); //No worky.
GivePlayerMoney(playerid, Info[6]); //Works
Info[10] and Info[11] Are the only ones giving problems, I already debugged in mysql, And its getting the correct INT's, but sscanf is the only thing giving troubles.. Everything else works though! except the last 3 things!
Re: sscanf problem... -
DiddyBop - 10.08.2010
bump skittle bump..
Re: sscanf problem... -
Daren_Jacobson - 10.08.2010
don't you mean the array specifier?
Re: sscanf problem... -
Daren_Jacobson - 10.08.2010
I was just thinking because his isn't an enum already wouldn't you want to do array?
pawn Код:
sscanf(row, "p<|>ds[100]s[100]a<d>[7]s[100]a<d>[2]s[100]ds[100]a<d>[4]", Info[0], Info2[0], Info2[1], Info[1], Info2[2], Info2[3], Info2[5], Info[8], Info2[6], Info[9]);
rearranging your mysql columns might be beneficial.
Re: sscanf problem... -
DiddyBop - 10.08.2010
Hm.. so i need to make an array? or rearrange mysql columns to the important ones?
Re: sscanf problem... -
Daren_Jacobson - 10.08.2010
neither, it would just improve read/code-ability.
Re: sscanf problem... -
DiddyBop - 13.08.2010
Quote:
Originally Posted by Daren_Jacobson
neither, it would just improve read/code-ability.
|
uhm.. How?..
Re: sscanf problem... -
DiddyBop - 14.08.2010
k. So i guess make an enum to store the rest of data?