wrong pass
#5

Quote:
Originally Posted by Mr_DjolE
Посмотреть сообщение
Again udb...

Also
pawn Код:
if(!strcmp(udb_hash(Pass)), PlayerInfo[playerid][pPass])
{
    //do login
}
Argument mismatch.

Quote:
Originally Posted by HireMe
Посмотреть сообщение
Like tyler set make it look like:

pawn Код:
CMD:login(playerid, params[])
{
            new filestring[128];
            new name[24];
            GetPlayerName(playerid, name, 24);
            format(filestring, sizeof(filestring), "/Users/%s.ini", name);
            if(!fexist(filestring)) return SCM(playerid, COLOR_YELLOW, "You are not registered. Please /register.");
            new lpass[64];
            if(PlayerInfo[playerid][pLogged] == 1) return SCM(playerid, COLOR_YELLOW, "You are already logged in.");
            if(sscanf(params, "s[64]", lpass)) return SCM(playerid, -1, "{F70505}Usage: {FFFFFF}/login [password]");
            INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
            if(udb_hash(lpass) == PlayerInfo[playerid][pPass])
            {
                    SetPlayerCash(playerid, PlayerInfo[playerid][pCash]);
                    SetPlayerScore(playerid, PlayerInfo[playerid][pKills]);
                    SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pRank]);
                    PlayerInfo[playerid][pLogged] += 1;
                    SCM(playerid,0x0080C0FF,"System: Account data loaded! Welcome back!");
            }
            else
            {
            SCM(playerid,0x0080C0FF,"System: Wrong password!");
            }
            return 1;
}
an i think it'll work
Sometimes it works and sometimes not. I get "unknown command" at /register and /login sometimes.

I think
pawn Код:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
is bugged, i tried to add on OnPlayerConnect but both register and login cmds wasn't working.
Reply


Messages In This Thread
wrong pass - by Face9000 - 14.12.2012, 21:52
Re: wrong pass - by tyler12 - 14.12.2012, 21:54
Re: wrong pass - by HireMe - 14.12.2012, 21:57
Re: wrong pass - by Djole1337 - 14.12.2012, 22:01
Re: wrong pass - by Face9000 - 14.12.2012, 22:08
Re: wrong pass - by tyler12 - 14.12.2012, 22:10
Re: wrong pass - by Face9000 - 14.12.2012, 22:18
Re: wrong pass - by Gh05t_ - 14.12.2012, 22:26
Re: wrong pass - by Face9000 - 14.12.2012, 22:30
Re: wrong pass - by Gh05t_ - 14.12.2012, 22:42

Forum Jump:


Users browsing this thread: 2 Guest(s)