Problem ussing sscanf mysql login system not splitting username and password up - 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 ussing sscanf mysql login system not splitting username and password up (
/showthread.php?tid=545927)
Problem ussing sscanf mysql login system not splitting username and password up -
Kontrol - 11.11.2014
Hello when i log in and then print my name it shows up as this
"Username|487ewifhdsjbjdsbfjsdgfhdsgfdsufiyhsdjhfb wbshjbfduih"
its printing the username and password which is using whirlpool together how can i solve this?
Код:
new result[256];
mysql_fetch_row(result);
sscanf(result, "p<|>{s[25]s[130]}i",PlayerInfo[playerid][pAdminLevel]); // This line is causing the problem
PlayerInfo[playerid][pLogged] = 1;
Heres the full login command
http://pastebin.com/U0uVM2LL
Re: Problem ussing sscanf mysql login system not splitting username and password up -
Kontrol - 11.11.2014
anybody?
Re: Problem ussing sscanf mysql login system not splitting username and password up -
nemesis- - 12.11.2014
Can you show sample output from the select * from users SQL statement? It looks syntactically correct on the sscanf and you aren't touching the other parts of your enum so they should be unaffected.
Re: Problem ussing sscanf mysql login system not splitting username and password up -
dazman14 - 12.11.2014
Your problem is the sscanf line. Your not defining the enums from the gathering....
example:
Код:
sscanf(result, "p<|>{s[25]s[130]}i",PlayerInfo[playerid][user], PlayerInfo[playerid][pass], PlayerInfo[playerid][pAdminLevel]);
I'm assuming you've written the correct p<|> order from the actual database order to gather and store.
Darren
Re: Problem ussing sscanf mysql login system not splitting username and password up -
DavidBilla - 12.11.2014
Quote:
Originally Posted by dazman14
Your problem is the sscanf line. Your not defining the enums from the gathering....
example:
Код:
sscanf(result, "p<|>{s[25]s[130]}i",PlayerInfo[playerid][user], PlayerInfo[playerid][pass], PlayerInfo[playerid][pAdminLevel]);
I'm assuming you've written the correct p<|> order from the actual database order to gather and store.
Darren
|
You don't need to specify variables for quiet sections
Btw @OT, why would you use 'p' specifier for a sscanf line that has only an integer and other stuffs are in quiet sections.
You do have another sscanf line right? In which the strings are not in quiet sections.
Re: Problem ussing sscanf mysql login system not splitting username and password up -
Kontrol - 12.11.2014
Quote:
Originally Posted by nemesis-
Can you show sample output from the select * from users SQL statement? It looks syntactically correct on the sscanf and you aren't touching the other parts of your enum so they should be unaffected.
|
i dont fully understand, example of what?