12.05.2015, 19:46
Sure, here's the callback:
Код:
inline SQLOnAccountCheck() { if(playerid != INVALID_PLAYER_ID) { new rows, fields; cache_get_data(rows, fields, SQL); if(rows) { pData[playerid][userid] = cache_get_row_int(0, 0, SQL); cache_get_row(0, 2, pData[playerid][password], SQL, 129); cache_get_row(0, 3, pData[playerid][salt], SQL, 257); LoginAttempts[playerid] = 0; new loginstring[70]; format(loginstring, sizeof(loginstring), "Welcome %s\n\nPlease enter your password.\n\n", GetNameEx(playerid)); Dialog_Show(playerid, d_Login, DIALOG_STYLE_PASSWORD, "Login", loginstring, "Login", ""); LoginTimer[playerid] = SetTimerEx("OnTimedKick", 70000, 0, "d", playerid); } } } mysql_pquery_inline(SQL, query, using inline SQLOnAccountCheck, "");
Код:
enum e_UserData { userid[8], password[129], salt[257] }; new pData[MAX_PLAYERS][e_UserData];