22.10.2014, 11:19
i am using mysql saving system but
Money and score not saving
Money and score not saving
pawn Код:
stock MySQL_Login(playerid)
{
new Query[1000];
mysql_real_escape_string(PlayerInfo[playerid][Nick], PlayerInfo[playerid][Nick]);
format(Query, sizeof(Query), "SELECT * FROM `playerdata` WHERE `nick` COLLATE latin1_general_cs = '%s' LIMIT 1", PlayerInfo[playerid][Nick]);
mysql_query(Query);
mysql_store_result();
while(mysql_fetch_row(Query))
{
mysql_fetch_int("id", PlayerInfo[playerid][ID]);
mysql_fetch_int("admin", PlayerInfo[playerid][Level]);
mysql_fetch_int("score", PlayerInfo[playerid][pScore]);
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
mysql_fetch_int("money", PlayerInfo[playerid][Money]);
GivePlayerMoney(playerid, PlayerInfo[playerid][Money]);
mysql_fetch_int("kills", PlayerInfo[playerid][Kills]);
mysql_fetch_int("deaths", PlayerInfo[playerid][Deaths]);
mysql_fetch_int("banned", PlayerInfo[playerid][banned]);
mysql_fetch_int("Donor", PlayerInfo[playerid][dRank]);
mysql_fetch_int("Pilot", PlayerInfo[playerid][pPilot]);
mysql_fetch_int("NavyPilot", PlayerInfo[playerid][jPilot]);
mysql_fetch_int("Helper", PlayerInfo[playerid][Helper]);
}
mysql_free_result();
PlayerInfo[playerid][LoggedIn] = 1;
return 1;
}