19.05.2015, 23:28
Hello, I have a problem, in the database do i make changes and saved, when he entered the game changes have not been applied. thank you.
stock MySQL_Login(playerid)
{
new query[300], pname[24], savingstring[256];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT * FROM playerdata WHERE user = '%s'", pname);
mysql_query(query);
mysql_store_result();
mysql_fetch_field_row(savingstring, "scores"); SetPlayerScore(playerid, strval(savingstring));
mysql_fetch_field_row(savingstring, "money"); GivePlayerMoney(playerid, strval(savingstring));
mysql_fetch_field_row(savingstring, "adminlevel"); PlayerInfo[playerid][pAdmin] = strval(savingstring);
mysql_fetch_field_row(savingstring, "helperlevel"); PlayerInfo[playerid][pHelper] = strval(savingstring);
mysql_fetch_field_row(savingstring, "kills"); PlayerInfo[playerid][pKills] = strval(savingstring);
mysql_fetch_field_row(savingstring, "deaths"); PlayerInfo[playerid][pDeaths] = strval(savingstring);
mysql_free_result();
MySQL_vLogin(playerid); //vip log in
PlayerInfo[playerid][pLogged] = 1;
return 1;
}
stock MySQL_Login(playerid)
{
new query[300], pname[24], savingstring[256];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT * FROM playerdata WHERE user = '%s'", pname);
mysql_query(query);
mysql_store_result();
mysql_fetch_field_row(savingstring, "scores"); SetPlayerScore(playerid, strval(savingstring));
mysql_fetch_field_row(savingstring, "money"); GivePlayerMoney(playerid, strval(savingstring));
mysql_fetch_field_row(savingstring, "adminlevel"); PlayerInfo[playerid][pAdmin] = strval(savingstring);
mysql_fetch_field_row(savingstring, "helperlevel"); PlayerInfo[playerid][pHelper] = strval(savingstring);
mysql_fetch_field_row(savingstring, "kills"); PlayerInfo[playerid][pKills] = strval(savingstring);
mysql_fetch_field_row(savingstring, "deaths"); PlayerInfo[playerid][pDeaths] = strval(savingstring);
mysql_free_result();
MySQL_vLogin(playerid); //vip log in
PlayerInfo[playerid][pLogged] = 1;
return 1;
}