SA-MP Forums Archive
[HELP] Problem with /login - 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: [HELP] Problem with /login (/showthread.php?tid=83142)



[HELP] Problem with /login - Lorrden - 22.06.2009

Well, I've allways used dudb when creating login/register but now I felt some more compitition...
but it became too much :S

Here's the code:
pawn Код:
if(strcmp(cmd, "/login", true) == 0)
    {
      new tmppass[64];
        if (pLoggedIn[playerid] == 1) return SendClientMessage(playerid, RED,"[ERROR]: You're already logged in!");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, RED,"[ERROR]: Correct usage: '/login <password>'");
        strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
        EncryptPassword(tmppass);
//there should be something like if(!tmppass == PlayerInfo[playerid][pPassword]) return SendClientMessage(playerid, RED,"[ERROR]: Wrong password."); here
        pLoggedIn[playerid] = 1;
        LoadPlayerStats(playerid,tmppass);
        return 1;
    }
And the problem:
- You get logged in weather you type the right password or not...

I understand that there need to be some function checking if tmppass is the same as PlayerInfo[playerid][pPassword] but I can't figure out the solution... -.-

Please help me guys :P