02.09.2011, 18:34
(
Last edited by BlackWolf120; 03/09/2011 at 12:34 AM.
)
hi,
ive set up a mysql database cause i wanna get rid of dini.
But i have some problems.
Saving on disconnect works, also the login with the password ive registered but the player does not get the stats back after login he saved on disconnect.
there are 2 prints in this script and they show the right stats. (the row that has been fetched and every value is correct in the print)
But after spawn i get none of them.
So where could be the bug?
I hope someone can help me
ive set up a mysql database cause i wanna get rid of dini.
But i have some problems.
Saving on disconnect works, also the login with the password ive registered but the player does not get the stats back after login he saved on disconnect.
pawn Code:
new Query[256], pname[24];
GetPlayerName(playerid, pname, 24);
format(Query, sizeof(Query), "SELECT * FROM `Users` WHERE `name` = '%s'", pname);
mysql_query(Query);
mysql_store_result();
new row[1400];
if(mysql_num_rows() == 0 )
{
print("MySQL Error: Account not found in MySQL Database!");
}
else
{
mysql_fetch_row(row);
print(row);// heres a print
sscanf(row, "p<|>ddddddddddddddddddddddddddddddddddddddd",
SetPlayerScore(playerid,GetPlayerScore(playerid)),Cash[playerid],kills[playerid],tode[playerid],Spieler[playerid][AdminLevel],
bombsmuggelcounter[playerid],countdownstartcounter[playerid],bombdisablecounter[playerid],foundmoneybag[playerid],
playedmoneyrush[playerid],Hours[playerid],Minutes[playerid],randomwepgot[playerid],suddendeathmode[playerid],
moneyrushstartcount[playerid],drugamount[playerid],RoundsWon[playerid],RoundsLost[playerid],weaponsbought[playerid],
reactionwon[playerid],DrugsTaken[playerid],cookie[playerid],LottoWins[playerid],LottoWins[playerid],ChainsawRounds[playerid],
WonChainsawing[playerid],ProCookies[playerid],c4[playerid],condom[playerid],RapedPeople[playerid],GotBriefCase[playerid],
strike[playerid],strikeDone[playerid],c4done[playerid],ProRank[playerid],Spieler[playerid][Vip],AbsoluteFirstSpawn[playerid],
WonDuels[playerid],LostDuels[playerid],IsPlayerBanned[playerid]);
pRank[playerid] = floatround(floatpower((kills[playerid] / 25), 0.5), floatround_floor);
if(pRank[playerid] >= FUNCTION(sizeof RankName)) pRank[playerid] = (sizeof RankName - 1);
}
mysql_free_result();
print(row);//heres a print
But after spawn i get none of them.
So where could be the bug?
I hope someone can help me