[11:53:45] Incoming connection: 127.0.0.1:49866 [11:53:45] [join] Jason_Smith has joined the server (0:127.0.0.1) [11:53:51] sscanf warning: String buffer overflow. [11:53:51] sscanf warning: Format specifier does not match parameter count. [11:53:51] Loaded [11:53:51] Loaded 2 [11:53:58] Player Saved [11:53:58] [part] Jason_Smith has left the server (0:1) |
stock LoadStats(playerid) { new Query[2048]; format(Query, sizeof(Query), "SELECT * FROM playerdata WHERE Name = '%s'", GetName(playerid)); mysql_query(Query); mysql_store_result(); mysql_fetch_row_format(Query, "|"); sscanf(Query, "e<p<|>s[23]s[24]dddddfffdddddd>", PlayerInfo[playerid][Name], PlayerInfo[playerid][Password], PlayerInfo[playerid][Cash], PlayerInfo[playerid][Bank], PlayerInfo[playerid][PH], PlayerInfo[playerid][Level], PlayerInfo[playerid][Skin], PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ], PlayerInfo[playerid][Int], PlayerInfo[playerid][VW], PlayerInfo[playerid][Job], PlayerInfo[playerid][Job2], PlayerInfo[playerid][Jail], PlayerInfo[playerid][Bail]); print("Loaded"); mysql_free_result(); format(Query, sizeof(Query), "SELECT * FROM playerdata WHERE Name = '%s'", GetName(playerid)); mysql_query(Query); mysql_store_result(); mysql_fetch_row_format(Query, "|"); sscanf(Query, "e<p<|>dddddddddd>", PlayerInfo[playerid][Faction], PlayerInfo[playerid][FacRank], PlayerInfo[playerid][Phone], PlayerInfo[playerid][Mats], PlayerInfo[playerid][Pot], PlayerInfo[playerid][Crack], PlayerInfo[playerid][Heroin], PlayerInfo[playerid][VIPLevel], PlayerInfo[playerid][Moderator], PlayerInfo[playerid][Admin]); print("Loaded 2"); mysql_free_result(); return 1; }
PlayerInfo[playerid][Name] is smaller than 23, or PlayerInfo[playerid][Password] is smaller than 24. Also unless you like server lags, consider moving to threaded queries.
|
enum pInfo { Name[23], Password[24], Cash, Bank, PH, Level, Skin, Float:PosX, Float:PosY, Float:PosZ, Int, VW, Job, Job2, Jail, Bail, Faction, FacRank, Phone, Mats, Pot, Crack, Heroin, VIPLevel, Moderator, Admin } new PlayerInfo[MAX_PLAYERS][pInfo];