11.06.2010, 14:53
I had just finished an mysql login/register so here is what i used :
Also at the onplayerconnect
i'm guessing that you already have the mysqlcheckaccount function .
pawn Код:
new query[128];
new row[10];
/// -- ADMIN -- //
format(query, sizeof(query), "SELECT `AdminLevel` FROM `players` WHERE `id` = %d LIMIT 1", PlayerInfo[playerid][pSQLID]);
samp_mysql_query(query);
samp_mysql_store_result();
samp_mysql_fetch_row(row);
PlayerInfo[playerid][AdminLevel] = strval(row);
/// -- Money -- ///
format(query, sizeof(query), "SELECT `Money` FROM `players` WHERE `id` = %d LIMIT 1", PlayerInfo[playerid][pSQLID]);
samp_mysql_query(query);
samp_mysql_store_result();
samp_mysql_fetch_row(row);
PlayerInfo[playerid][Money] = strval(row);
///// ETC ETC /////
pawn Код:
new sqlaccountstatus = MySQLCheckAccount(plname);
PlayerInfo[playerid][pSQLID] = sqlaccountstatus;