19.10.2012, 16:44
How can I replace mysql_strtok?
I'm a beginner at MySQL.
Anyway, here's the code:
I'm a beginner at MySQL.
Anyway, here's the code:
pawn Код:
public OnPlayerLogin(playerid,password[]) // by Luk0r v1.0
{
MySQLCheckConnection();
new tmp2[256];
new string2[64];
new str[128];
new
string[256]
;
new playername2[MAX_PLAYER_NAME];
new playernamesplit[3][MAX_PLAYER_NAME];
GetRPName(playerid, playername2, sizeof(playername2));
split(playername2, playernamesplit, '_');
MySQLFetchAcctSingle(KasutajaInfo[playerid][pSQLID], "Password", KasutajaInfo[playerid][pKey]);
if(!strcmp(KasutajaInfo[playerid][pKey],password, true ) )
{
new Data[1024];
new Field[64];
new rcnt = 1;
MySQLFetchAcctRecord(KasutajaInfo[playerid][pSQLID], Data);
mysql_strtok(Field, "|", Data);
while (mysql_strtok(Field, "|", "")==1)
{
if (rcnt == 3) KasutajaInfo[playerid][pLevel] = strval(Field);
if (rcnt == 4) KasutajaInfo[playerid][pAdmin] = strval(Field);
//A couple more lines...
rcnt++;
}
}