06.05.2011, 18:42
(
Последний раз редактировалось Brendan_Thomson; 09.05.2011 в 15:36.
)
for those using this plugin looking for a replacement method, me and my infinite wisdom have divised an alternative.
this replaces the code from the old MySQL plugin..
EDIT: I'm fairly sure there is something wrong with this code somewhere, still figuring it out.
EDIT2: make sure you remove rcnt++; from the bottom of the section (or it will skip every second field)
pawn Код:
MySQLFetchAcctRecord(PlayerInfo[playerid][pSQLID], Data);
for (new rcnt = 0; rcnt < mysql_num_fields(); rcnt++)
{
mysql_fetch_field_num(rcnt, Field, MainDB);
// The rcnt values here represent the order of the columns in the characters table, so don't mess with them
// If you add a column to the table, just add a new line with a +1 rcnt to the block below
// Start it at 3 to skip the first few records we don't need (id, player name, password)
if (rcnt == 3) PlayerInfo[playerid][pLevel] = strvalEx(Field);
pawn Код:
MySQLFetchAcctRecord(PlayerInfo[playerid][pSQLID], Data);
samp_mysql_strtok(Field, "|", Data);
while (samp_mysql_strtok(Field, "|", "")==1)
{
// The rcnt values here represent the order of the columns in the characters table, so don't mess with them
// If you add a column to the table, just add a new line with a +1 rcnt to the block below
// Start it at 3 to skip the first few records we don't need (id, player name, password)
if (rcnt == 3) PlayerInfo[playerid][pLevel] = strvalEx(Field);
EDIT2: make sure you remove rcnt++; from the bottom of the section (or it will skip every second field)