27.09.2015, 10:06
Ok the syntax error is gone but still doesn't load stats.
mysql_log:
OnAccountCheck:
mysql_log:
Quote:
[06:02:39] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `IP`, `Password`, `ID` FROM `players` WHERE `Username` = '%e' LIMIT 1" [06:02:39] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `IP`, `Password`, `ID` FROM `players` WHERE `Username` = ", callback: "OnAccountCheck", format: "i" [06:02:39] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called [06:02:39] [DEBUG] mysql_tquery - scheduling query "SELECT `IP`, `Password`, `ID` FROM `players` WHERE `Username` = 'Face9000' LIMIT 1".. [06:02:39] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE ServerStats SET TotalJoins = TotalJoins + 1", callback: "(null)", format: "(null)" [06:02:39] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called [06:02:39] [DEBUG] mysql_tquery - scheduling query "UPDATE ServerStats SET TotalJoins = TotalJoins + 1".. [06:02:39] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(i)] - starting query execution [06:02:39] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(i)] - query was successful [06:02:39] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [06:02:39] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(i)] - data being passed to ProcessCallbacks() [06:02:39] [DEBUG] CMySQLQuery::Execute[()] - starting query execution [06:02:39] [DEBUG] CMySQLQuery::Execute[()] - query was successful [06:02:39] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving [06:02:39] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks() [06:02:39] [DEBUG] Calling callback "OnAccountCheck".. [06:02:39] [DEBUG] cache_get_data - connection: 1 [06:02:39] [DEBUG] cache_get_field_content - row: 0, field_name: "IP", connection: 1, max_len: 16 [06:02:39] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "IP", data: "HIDDEN IP" [06:02:39] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [06:02:39] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called [06:02:39] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Admin", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "VIP", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Money", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Score", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Deaths", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "MissionsPlayed", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "VipTime", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Warns", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Cookies", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Jailed", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Muted", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Duty", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Nopm", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:02:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Score", connection: 1 [06:02:42] [WARNING] cache_get_field_content_int - no active cache [06:03:29] [DEBUG] mysql_format - connection: 1, len: 700, format: "UPDATE `players` SET `IP` = '%s', `Admin` = '%i', `VIP` = '%i', `Deaths` = '%i', `Score` = '%i', `Money` = '%i', `MissionsPlayed..." [06:03:29] [ERROR] mysql_format - no value for specifier "%i" available [06:03:29] [DEBUG] mysql_format - connection: 1, len: 500, format: "UPDATE `players` SET `VipTime` = '%s', `Warns` = '%i', `Cookies` = '%i', `Jailed` = '%i', `Muted` = '%i', `RegisterDate` = '%s'..." [06:03:29] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `players` SET `IP` = 'HIDDEN IP', `Admin` = '0', `VI", callback: "(null)", format: "(null)" [06:03:29] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called [06:03:29] [DEBUG] mysql_tquery - scheduling query "UPDATE `players` SET `IP` = 'HIDDEN IP', `Admin` = '0', `VIP` = '0', `Deaths` = '0', `Score` = '0', `Money` = '0', `MissionsPlayed` = '0' WHERE `ID` = ''".. [06:03:29] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `players` SET `VipTime` = '', `Warns` = '0', `Cookies` =", callback: "(null)", format: "(null)" [06:03:29] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called [06:03:29] [DEBUG] mysql_tquery - scheduling query "UPDATE `players` SET `VipTime` = '', `Warns` = '0', `Cookies` = '0', `Jailed` = '0', `Muted` = '0', `RegisterDate` = '', `Duty` = '0', `Nopm` = '0' WHERE `ID` = '0'".. [06:03:29] [DEBUG] mysql_format - connection: 1, len: 700, format: "UPDATE `players` SET `IP` = '%s', `Admin` = '%i', `VIP` = '%i', `Deaths` = '%i', `Score` = '%i', `Money` = '%i', `MissionsPlayed..." [06:03:29] [ERROR] mysql_format - no value for specifier "%i" available [06:03:29] [DEBUG] mysql_format - connection: 1, len: 500, format: "UPDATE `players` SET `VipTime` = '%s', `Warns` = '%i', `Cookies` = '%i', `Jailed` = '%i', `Muted` = '%i', `RegisterDate` = '%s'..." [06:03:29] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `players` SET `IP` = 'HIDDEN IP', `Admin` = '0', `VI", callback: "(null)", format: "(null)" [06:03:29] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called [06:03:29] [DEBUG] mysql_tquery - scheduling query "UPDATE `players` SET `IP` = 'HIDDEN IP', `Admin` = '0', `VIP` = '0', `Deaths` = '0', `Score` = '0', `Money` = '0', `MissionsPlayed` = '0' WHERE `ID` = ''".. [06:03:29] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `players` SET `VipTime` = '', `Warns` = '0', `Cookies` =", callback: "(null)", format: "(null)" [06:03:29] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called [06:03:29] [DEBUG] mysql_tquery - scheduling query "UPDATE `players` SET `VipTime` = '', `Warns` = '0', `Cookies` = '0', `Jailed` = '0', `Muted` = '0', `RegisterDate` = '', `Duty` = '0', `Nopm` = '0' WHERE `ID` = '0'".. [06:03:29] [DEBUG] CMySQLQuery::Execute[()] - starting query execution [06:03:29] [DEBUG] CMySQLQuery::Execute[()] - query was successful [06:03:29] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving [06:03:29] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks() |
Код:
public OnAccountCheck(playerid) { new rows, fields; cache_get_data(rows, fields, mysql); if(rows) { cache_get_field_content(0, "IP", IP[playerid], mysql, 16); new newIP[16]; GetPlayerIp(playerid, newIP, 16); IsPlayerRegisterd[playerid] = 1; if(strlen(IP[playerid]) != 0 && !strcmp(IP[playerid], newIP, true)) { GameTextForPlayer(playerid, "Loading Account", 3000, 3); SetTimerEx("OnAccountLoad", 3000, false, "i", playerid); } else { (!strlen(IP[playerid]) || strcmp(IP[playerid], newIP, true)); cache_get_field_content(0, "Password", pData[playerid][Password], mysql, 129); pData[playerid][ID] = cache_get_field_content_int(0, "ID"); printf("%s", pData[playerid][Password]); ShowPlayerDialog(playerid, dLOGIN, DIALOG_STYLE_INPUT, "Login", "In order to play, you need to login", "Login", "Quit"); } } else { ShowPlayerDialog(playerid, dREGISTER, DIALOG_STYLE_INPUT, "Register", "In order to play, you need to register.", "Register", "Quit"); } return 1; }
Код:
public OnAccountLoad(playerid) { new score; pData[playerid][Admin] = cache_get_field_content_int(0, "Admin"); pData[playerid][VIP] = cache_get_field_content_int(0, "VIP"); pData[playerid][Money] = cache_get_field_content_int(0, "Money"); pData[playerid][Score] = cache_get_field_content_int(0, "Score"); pData[playerid][Deaths] = cache_get_field_content_int(0, "Deaths"); pData[playerid][MissionsPlayed] = cache_get_field_content_int(0, "MissionsPlayed"); pData[playerid][VipTime] = cache_get_field_content_int(0, "VipTime"); pData[playerid][Warns] = cache_get_field_content_int(0, "Warns"); pData[playerid][Cookies] = cache_get_field_content_int(0, "Cookies"); pData[playerid][Jailed] = cache_get_field_content_int(0, "Jailed"); pData[playerid][Muted] = cache_get_field_content_int(0, "Muted"); pData[playerid][Duty] = cache_get_field_content_int(0, "Duty"); pData[playerid][Nopm] = cache_get_field_content_int(0, "Nopm"); score = cache_get_field_content_int(0, "Score"); SetPlayerScore(playerid, score); GivePlayerCash(playerid, pData[playerid][Money]); SendClientMessage(playerid,red,"------------------------------------------------------"); new playername3[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername3, sizeof(playername3)); new string[128]; format(string,sizeof(string),"* System: Welcome back {F70505}%s (%d) {FFFFFF} - Your stats have been restored.",playername3,playerid); SCM(playerid,-1,string); SendClientMessage(playerid,red,"------------------------------------------------------"); CheckVipTime(playerid); Logged[playerid] = 1; return 1; }