SA-MP Forums Archive
MySql question - 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 question (/showthread.php?tid=214406)



MySql question - DRIFT_HUNTER - 21.01.2011

Well these is most confusing part for me...

I have saved in mysql users debase next info

User
Password
IP
Level
Kills
Deaths
Money

and i have
pawn Код:
enum pInfo
{
    IP,
    Level,
    Kills,
    Deaths,
    Money
}
So when i must log him in i fetch row and comes confusing part

pawn Код:
while(mysql_fetch_row_format(iQuery,"|"))
{
    sscanf(iQuery,"e<p<|>s[24]s[24]s[34]dddd>",AccInfo[playerid]);
}
I KNOW THAT THESE WILL NOW WORK
So how i can set player variables but not waste 82 cells?

The only way i know that these will work is:

pawn Код:
while(mysql_fetch_row_format(iQuery,"|"))
{
    new tmp1[3][82];
    new tmp2[4];
    sscanf(iQuery,"e<p<|>s[24]s[24]s[34]dddd>",tmp1[0],tmp1[1],tmp1[2],tmp2[0],tmp2[1],tmp2[2],tmp2[3]);
    AccInfo[playerid][Level] = tmp2[0];
    //And continue...
}
Is it possible to optimize these crap or im fucked up?


Re: MySql question - xxmitsu - 21.01.2011

Try to see if this code works:
pawn Код:
sscanf(iQuery,"e<p<|>{s}{s}s[34]dddd>",AccInfo[playerid]);