sscanf weird thing - 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: sscanf weird thing (
/showthread.php?tid=531163)
sscanf weird thing -
alanhutch - 11.08.2014
Hi all.
A user helped me with mine Character System, it's all good, but when i login, for select a Character this appears.
It should be "Christian_McGuire" and the other 2 lists "- Crea un personaggio -".
But in the second box, it appears "ian_McGuire" a part of the first name.
Here's the code and a screen.
pawn Код:
GetPlayerName(playerid, name, 24);
mysql_real_escape_string(name, Escape[0]); // This function makes sure you don't get MySQL injected. Read about it by searching it on ******.
format(string, 128, "SELECT * FROM users WHERE username = '%s'", Escape[0]);
mysql_query(string);
new str[512];
mysql_store_result();
sscanf(str,"p<|>s[24]s[24]s[24]",PlayerInfo[playerid][pNomePersonaggio1],PlayerInfo[playerid][pNomePersonaggio2],PlayerInfo[playerid][pNomePersonaggio3]);
mysql_free_result();
Thanks, this is a little urgent, i have to open my server at 16