sscanf problems
#1

Hi all

I'm having some strange problems with, what appears to be sscanf here. After I make a query, I'm using sscanf to assign the data to a enum, here's my code:
pawn Code:
new Query[2000],pip[16];
    GetPlayerIp(playerid,pip,16);
    format(Query, sizeof(Query), "SELECT * FROM `Users` WHERE `Username` = '%s' ", GetPlayerNameEx(playerid));
    mysql_query(Query);
    mysql_store_result();
    mysql_fetch_row_format(Query, "|");
    sscanf(Query, "e<p<|>s[32]s[130]s[129]is[16]iiiiis[121]i>",PInfo[playerid]);
    mysql_free_result();
It used to work in a old script I've made a quite a while ago. I already tried changing the 'i's to 'd's, but without any succes. As you can see, I increased the size of the string of the query, to make sure it wasn't that that caused the problem. The mysql debug shows that the query was succesfull, and that all the values were loaded correctly. As soon as it passes the sscanf function, the values are cut off, and sometimes blank. Here's the 'print':
Code:
[19:05:37] username  8589A9 0 127.0.0 0 0 0 0 0  0
It shows like this in the mysql debug log:
Code:
[18:56:51] CMySQLHandler::FetchRow() - Return: username|F534503140AF8C9FE46E35593CD100CEB7E82DDC99180078AA6579FDEBE4A3B7DA508F653239DD192F4F757290991A06D916EF3FCFC12E95A5C782F4EF8589A9|email@email|0|127.0.0.1|240|0|0|23|1|awesome text|0
Also tried increasing the IP string size, but no change. I'm not sure whether it's sscanf here, or something else. Any help would be appreciated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)