SA-MP Forums Archive
MySQL password login 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 password login problem. (/showthread.php?tid=207226)



MySQL password login problem. - exDDDD - 05.01.2011

pawn Код:
public OnPlayerLogin(playerid,password[])
{
    new tmp2[256];
    new string2[64];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    MySQLFetchAcctSingle(playerid, "Password", PlayerInfo[playerid][pKey]);
    if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
    {
        new Data[1024];
        new Field[64];
        new rcnt = 1;
        MySQLFetchAcctRecord(playerid, Data);
        if (rcnt == 3) PlayerInfo[playerid][pLevel] = strval(Field);
Alabala password, I write aa, I log
How do I fix?


Re: MySQL password login problem. - veyron - 05.01.2011

there should be ! before strcmp
e: noticed == 0, so it shouldnt be there
i think playerid in:
pawn Код:
MySQLFetchAcctSingle(playerid, "Password", PlayerInfo[playerid][pKey]);
should be sqlid ( i dont know what variable are you using to store sqlid, so replace it)


Re: MySQL password login problem. - exDDDD - 05.01.2011

moderntopia it is, but SQLID defined? I think not.


Re: MySQL password login problem. - veyron - 05.01.2011

PlayerInfo[playerid][pSQLID]


Re: MySQL password login problem. - exDDDD - 05.01.2011

nothing .. well ..


Re: MySQL password login problem. - exDDDD - 06.01.2011

reply?


Re: MySQL password login problem. - exDDDD - 07.01.2011

;| pls, reply?


Re: MySQL password login problem. - hanzen - 07.01.2011

You can do this in a single query and a if(). I'm just wondering why you are doing it this way.


Re: MySQL password login problem. - exDDDD - 07.01.2011

Give me an example