02.08.2012, 08:39
So I have this problem, everything else is working but the VIP wont load. This is the stock:
A players' VIP level in the database is 3, but it wont load when he/she logs in.
This is the MySQL log:
On this line you see, that the VIP level is 3 (the 2nd number)
But it wont load the level 3 VIP, and in the mysql_log it says:
pawn Код:
stock Login(playerid)
{
new query[128], string[64], money, score;
format(query, sizeof(query), "SELECT * FROM accounts WHERE user = '%s'", Name(playerid));
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query))
{
mysql_fetch_field_row(string, "admin"); PlayerInfo[playerid][pAdmin] = strval(string);
mysql_fetch_field_row(string, "vip"); PlayerInfo[playerid][pVIP] = strval(string);
mysql_fetch_field_row(string, "warnings"); PlayerInfo[playerid][pWarnings] = strval(string);
mysql_fetch_field_row(string, "score"); score = strval(string);
mysql_fetch_field_row(string, "money"); money = strval(string);
mysql_fetch_field_row(string, "kills"); PlayerInfo[playerid][pKills] = strval(string);
mysql_fetch_field_row(string, "deaths"); PlayerInfo[playerid][pDeaths] = strval(string);
mysql_fetch_field_row(string, "points"); PlayerInfo[playerid][pPoints] = strval(string);
}
mysql_free_result();
GivePlayerMoney(playerid, money);
SetPlayerScore(playerid, score);
PlayerInfo[playerid][pLogged] = 1;
UpdateStatsTextdraw(playerid);
SendClientMessage(playerid, C_LGREEN, "ACCOUNT: Successfully logged in.");
return 1;
}
This is the MySQL log:
pawn Код:
[11:42:52] CMySQLHandler::FetchRow() - Return: Username|c0516d978b6f895d0cf43d086f3d7245|0|3|0|48|29525|127.0.0.1|3|11|0
[11:42:52] >> mysql_fetch_field_row( Connection handle: 1 )
[11:42:52] CMySQLHandler::FetchField("admin") - 0
[11:42:52] >> mysql_fetch_field_row( Connection handle: 1 )
[11:42:52] CMySQLHandler::FetchField("vip") -
[11:42:52] >> mysql_fetch_field_row( Connection handle: 1 )
[11:42:52] CMySQLHandler::FetchField("warnings") - 0
[11:42:52] >> mysql_fetch_field_row( Connection handle: 1 )
[11:42:52] CMySQLHandler::FetchField("score") - 48
[11:42:52] >> mysql_fetch_field_row( Connection handle: 1 )
[11:42:52] CMySQLHandler::FetchField("money") - 29525
[11:42:52] >> mysql_fetch_field_row( Connection handle: 1 )
[11:42:52] CMySQLHandler::FetchField("kills") - 3
[11:42:52] >> mysql_fetch_field_row( Connection handle: 1 )
[11:42:52] CMySQLHandler::FetchField("deaths") - 11
[11:42:52] >> mysql_fetch_field_row( Connection handle: 1 )
[11:42:52] CMySQLHandler::FetchField("points") - 0
[11:42:52] >> mysql_fetch_row_format( Connection handle: 1 )
pawn Код:
[11:42:52] CMySQLHandler::FetchRow() - Return: Username|c0516d978b6f895d0cf43d086f3d7245|0|3|0|48|29525|62.65.63.64|3|11|0
pawn Код:
[11:42:52] >> mysql_fetch_field_row( Connection handle: 1 )
[11:42:52] CMySQLHandler::FetchField("vip") -