03.01.2014, 21:07
(
Последний раз редактировалось Jimmy0wns; 03.01.2014 в 22:39.
)
Hey, i'm using BlueG's plugin, but as soon as you login, it doesnt load your stats.
I hope someone knows what i'm doing wrong.
I hope someone knows what i'm doing wrong.
pawn Код:
stock MySQL_Login(playerid)
{
new Query[500];
mysql_real_escape_string(pInfo[playerid][Nick], pInfo[playerid][Nick]); // escaping the name of the player to avoid sql_injections.
format(Query, sizeof(Query), "SELECT * FROM `playerdata` WHERE `nick` COLLATE latin1_general_cs = '%s' LIMIT 1", pInfo[playerid][Nick]);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() > 0)
{
new line[500];
new data[42];
mysql_fetch_row(line);
sscanf(line, "p<|>iiiiii",
data[0],
data[1],
data[2],
data[3],
data[4],
data[5]);
data[0] = pInfo[playerid][ID];
data[1] = pInfo[playerid][pAdmin];
data[2] = pInfo[playerid][pScore];
SetPlayerScore(playerid, pInfo[playerid][pScore]);
data[3] = pInfo[playerid][pMoney];
GivePlayerMoney(playerid, pInfo[playerid][pMoney]);
data[4] = pInfo[playerid][pKills];
data[5] = pInfo[playerid][pDeaths];
}
mysql_free_result();
pInfo[playerid][Logged] = 1;
}