MySQL Problem. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL Problem. (
/showthread.php?tid=247486)
MySQL Problem. -
GaB1TzZzu - 09.04.2011
OnPlayerLogin:
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);
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 !
Re: MySQL Problem. -
linuxthefish - 10.04.2011
So you want to make a OnPlayerLogin callback? Or make something that logs the player in through MySQL?
Stop double posting, it makes me feel sad...
Re: MySQL Problem. -
GaB1TzZzu - 11.04.2011
It works fine, but i want to change MySQL plugin. Now i`m using Adrenaline's MySQL plugin, and i want to change in G-StyleZzZ plugin.