02.09.2013, 07:34
(
Последний раз редактировалось viveka27; 04.09.2013 в 08:36.
)
CODE
And I am Set Timer in onplayerconnect
SetTimerEx("SafeOnPlayerConnect", 1000, 0, "d", playerid);
But OnAccountCheck not called.So Screen Like This

Код:
public SafeOnPlayerConnect(playerid)
{
SendClientMessage(playerid, WHITE, "[DEBUG]: MAU #1");
CheckAccount(playerid);
return 1;
}
public CheckAccount(playerid)
{
new query[82];
format(query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `Username` = '%s'", PlayerName(playerid));
mysql_function_query(handle, query, true, "OnAccountCheck", "d", playerid);
SendClientMessage(playerid, WHITE, "[DEBUG]: Mau #2");
return 1;
}
public OnAccountCheck(playerid)
{
if(playerid != INVALID_PLAYER_ID) {
new rows, fields;
cache_get_data(rows, fields, handle);
new string[250];
for (new i = 1; i <= 50; i++) SendClientMessage(playerid, -1, " ");
SendClientMessage(playerid, WHITE, "[DEBUG]: Mau #3");
if(rows) {
cache_get_row(0,2,PlayerInfo[playerid][pKey],handle, 128);
format(string, sizeof(string), "Selamat Datang Kembali Di %s, %s.", SERVER_NAME, PlayerName(playerid));
SendClientMessage(playerid, GREY, string);
SendClientMessage(playerid, WHITE, "[DEBUG]: Show Dialog Login");
SendClientMessage(playerid, WHITE, "That name is currently registered, please log into your account.");
ShowMainMenuDialog(playerid, 1);
}
else {
format(string, sizeof(string), "Selamat Datang Di %s, %s.", SERVER_NAME, PlayerName(playerid));
SendClientMessage(playerid, GREY, string);
SendClientMessage(playerid, WHITE, "[DEBUG]: Show Dialog Register");
SendClientMessage(playerid, WHITE, "That name is currently not registered.");
SendClientMessage(playerid, WHITE, "If you wish to register, please input your password in the box below.");
ShowMainMenuDialog(playerid, 2);
}
}
return 1;
}
SetTimerEx("SafeOnPlayerConnect", 1000, 0, "d", playerid);
But OnAccountCheck not called.So Screen Like This

MySQL Log:
Код:
16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:29] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:30:29] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1). [16:30:46] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:31:19] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0). [16:31:19] [ERROR] "cache_get_data" - invalid connection handle. (ID = 1).
Question:
How To Fix It? Thanks
How To Fix It? Thanks


