09.04.2011, 15:57
OnPlayerLogin:
I`m using Adrenaline's MySQL plugin, and i want to do OnPlayerLogin with G-StylezZz's plugin. His plugin doesn't have samp_mysql_strtok, so how can i do OnPlayerLogin with mysql_fetch_row_format ?
Thanks !
pawn Код:
MySQLFetchAcctSingle(PlayerInfo[playerid][pSQLID], "Password", PlayerInfo[playerid][pKey]);
if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
{
new Data[1024];
new Field[64];
new rcnt = 1;
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] = strval(Field);
Thanks !