sscanf weird thing
#1

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)