Sscanf query failing with skin. - 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 query failing with skin. (
/showthread.php?tid=401768)
Sscanf query failing with skin. -
FalconWingsX - 23.12.2012
Hi, I am having trouble with fetching the skin for a player, it should be retrieving the skin from "skin" but instead, it retrieves it from "score" which is quite odd.
pawn Код:
new query[500];
format(query, sizeof(query),"SELECT * FROM `playerdb` WHERE `username` = '%s'",playerdb[playerid][username]);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row(query,"|"))
{
sscanf(query, "p<|>e<s[25]s[35]iiiii>", playerdb[playerid]);
SetPlayerSkin(playerid, playerdb[playerid][skin]);
}
mysql_free_result();
return 1;
}
also, my enums are
Код:
username[MAX_PLAYER_NAME],
password[32],
score,
money,
power,
deaths,
skin,
Thanks for the help!
Re: Sscanf query failing with skin. -
[HiC]TheKiller - 24.12.2012
Check the order of your fields in the MySQL database. Something could be muddled up.
Re: Sscanf query failing with skin. -
FalconWingsX - 24.12.2012
Quote:
Originally Posted by ******
MAX_PLAYER_NAME is 24 not 25, and 32 is 32, not 35.
|
The reason I had those was to get rid of the string buffer overload, but apparently, that clogged up more bits.
Now i'm only left with the "string buffer overload" warning each time that gets called. But thanks!