[HELP] Problem with /login
#1

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)