07.05.2011, 13:41
I have a problem with stats saving: I want to do that then player disconnect stats of the this player will save to mysql base.
Everything works fine and files saves to mysql base without bug but then player login he cant get this Scores...
There is my codes:
Please help me.
Everything works fine and files saves to mysql base without bug but then player login he cant get this Scores...
There is my codes:
Код:
if(dialogid == 05) { if(response) { new name[128],query[256],scores[300]; GetPlayerName(playerid,name,128); if(IsPlayerConnected(playerid)) { MySQLCheck(); format(query,sizeof(query),"SELECT Money FROM `"TABLENAME"` WHERE Name = '%s' AND Password = md5('%s') LIMIT 1",name,inputtext); mysql_query(query); format(scores,sizeof(scores),"SELECT Scores FROM `"TABLENAME"` WHERE Name = '%s' AND Password = md5('%s') LIMIT 1",name,inputtext); mysql_query(scores); mysql_store_result(); if(mysql_num_rows() == 1) { PlayerMoney[playerid] = mysql_fetch_int(); PlayerTaskai[playerid] = mysql_query("SELECT Scores FROM `"TABLENAME"` WHERE Name = '%s' AND Password = md5('%s') LIMIT 1",name,inputtext); SendClientMessage(playerid,COLOR_LIGHTGREEN,"Jūs sėkmingai prisijungėte. Sekmės! ;)"); GivePlayerMoney(playerid,PlayerMoney[playerid]); SetPlayerScore(playerid,PlayerTaskai[playerid]); Logged[playerid] = true; } else { mysql_free_result(); ShowPlayerDialog(playerid,05,DIALOG_STYLE_INPUT,"Prisijungimas","Jūs įvedėte neteisingą slaptaћodį, proљome įvesti\n jūsų tikrą slaptaћodį.","Prisijungti","Iseiti"); return SendClientMessage(playerid,COLOR_RED,"Slaptaћodis neteisingas."); } } else { mysql_store_result(); mysql_free_result(); } } else if(!response) { Kick(playerid); return 1; } return 1; } return 1; }