CMD:debug(playerid, params []) { new st[100]; format(st, sizeof(st), "ID: %d", pInfo[playerid][pID]); SendClientMessage(playerid, -1, st); return 1; }
mysql_format(MySQLCon, query, sizeof(query), "SELECT * FROM `players` WHERE `user` = '%e' LIMIT 1", GetName(playerid)); mysql_pquery(MySQLCon, query, "OnAccountCheck", "d", playerid);
forward OnAccountCheck(playerid); public OnAccountCheck(playerid) { new string[228], rows = cache_num_rows(); if(rows) { cache_get_row(0, 2, pInfo[playerid][pPass], MySQLCon, 129); cache_get_field_content(0, "LastLogin", string), strmid(pInfo[playerid][pLastLogin], string, 0, 255, 255); //string..... ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{EDDC57}Login",string,"Login","Cancel"); } else { //string..... ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"{FFFB80}Registration",string,"Register","Cancel"); } return 1; }
if(dialogid == DIALOG_LOGIN) { if(!response) return Kick(playerid); if(!strcmp(PasswordHash(inputtext), pInfo[playerid][pPass], false)) { mysql_format(MySQLCon, query, sizeof(query), "SELECT * FROM `players` WHERE `user` = '%e' LIMIT 1", GetName(playerid)); mysql_pquery(MySQLCon, query, "OnPlayerLogin", "d", playerid); } }
forward OnPlayerLogin(playerid); public OnPlayerLogin(playerid) { new rows = cache_num_rows(); if(rows) { pInfo[playerid][pID] = cache_get_field_content_int(0, "ID"); pInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin"); pInfo[playerid][pHelper] = cache_get_field_content_int(0, "Helper"); pInfo[playerid][pMoney] = cache_get_field_content_int(0, "Money"); pInfo[playerid][pScore] = cache_get_field_content_int(0, "Score"); pInfo[playerid][pStatus] = cache_get_field_content_int(0, "Status"); pInfo[playerid][pReg] = cache_get_field_content_int(0, "Reg"); pInfo[playerid][pSex] = cache_get_field_content_int(0, "Sex"); pInfo[playerid][pAge] = cache_get_field_content_int(0, "Age"); pInfo[playerid][pMute] = cache_get_field_content_int(0, "Mute"); // ................. and so on } return 1; }
new szID[12];
cache_get_field_content(0, "ID", szID);
sscanf(szID, "p<|>d", pInfo[playerid][pID]);
enum PlayerInfo { pID, pPass[129], pAdmin, pHelper, pMoney, pScore, pStatus, pReg, pSex, pAge, pMute, pHoursPlayed, pRPoints, pBankMoney, pWantedLevel, pPhoneBook //......................... and so on } new pInfo[MAX_PLAYERS][PlayerInfo];
The number 48 happens to be the character code for the character 0. For me, that immediately raises a red flag because that likely means that there is a either a type mismatch or a buffer overflow.
However, I can't seem to spot any obvious mistake at first glance. You may try using tquery instead of pquery and see if that helps. Also run crashdetect and see if any runtime error (runtime error 4, especially) comes up. In your enum declaration, is there anything before ID? |