SA-MP Forums Archive
Password is right but says it's not ??? - 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: Password is right but says it's not ??? (/showthread.php?tid=145436)



Password is right but says it's not ??? - 0ne - 02.05.2010

pawn Код:
new File:account = fopen(str, io_read);
        if (account)
        {
          new pass[256];
          new passres[256], value[256];
          fread(account, pass, sizeof pass);
          passres = GetFileString(pass);
          if (!strcmp("Password", passres))
            {
                value = GetFileValue(pass);
                strmid(playerDB[playerid][Password], value, 0, strlen(value), 150);
            }
            if (!strcmp(playerDB[playerid][Password], slaptazodis, true))
            {
              while (fread(account, pass, 256))
                {
                    passres = GetFileString(pass);
                    if (strcmp("AdminLevel", passres, true))
                    {
                        value = GetFileValue(pass);
                        playerDB[playerid][AdminLevel] = strval(value);
                    }
                    if (strcmp("Cash", passres, true))
                    {
                        value = GetFileValue(pass);
                        playerDB[playerid][Cash] = strval(value);
                    }
            if (strcmp("warns", passres, true))
                    {
                        value = GetFileValue(pass);
                        playerDB[playerid][warns] = strval(value);
                    }
                    if (strcmp("warn1", passres, true))
                    {
                        value = GetFileValue(pass);
                        strmid(playerDB[playerid][warn1], value, 0, strlen(value), 128);
                    }
                    if (strcmp("warn2", passres, true))
                    {
                        value = GetFileValue(pass);
                        strmid(playerDB[playerid][warn2], value, 0, strlen(value), 128);
                    }
                if (strcmp("warn3", passres, true))
                    {
                        value = GetFileValue(pass);
                        strmid(playerDB[playerid][warn3], value, 0, strlen(value), 128);
                    }
                }
                fclose(account);
          playerDB[playerid][Logged] = 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Password incorrect.");
                new s[128];
              new loginname[MAX_PLAYER_NAME];
              GetPlayerName(playerid,loginname,MAX_PLAYER_NAME);
              format(s,sizeof(s),"Input your password",loginname);
              ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login",s,"Login","Cancel");
            fclose(account);
            return 1;
            }
this is what i got onplayerlogin , could anyone tell me what could be wrong here? I write good password but it results me as: Password incorrect, if i change this:

Код:
if (!strcmp(playerDB[playerid][Password], slaptazodis, true))
if i remove the ! from it always password incorrect, else if its even incorrect it logs me in < wtf?


Re: Password is right but says it's not ??? - Virtual1ty - 02.05.2010

Well for start dont use old, memory waste, slow, overedited, GF script.
That would solve all your problems.


Re: Password is right but says it's not ??? - 0ne - 02.05.2010

GF Script? Keep your toughts to yourself this is not even close to a GF script and its so not a Roleplay, i am doing my own without any damn edits!


Re: Password is right but says it's not ??? - Virtual1ty - 02.05.2010

The register/login system is similiar to ones used in Godfather/LARP/PENLS.
Make your own, and stop using ini_GetValue, and ini_GetKey functions, they're slow.
There's already a topic which ini system is the best for user account saving stuff. Check it out.
It's even in the same subforum!



Re: Password is right but says it's not ??? - 0ne - 02.05.2010

The thread says: Password is right but says it's not

I will do those "fasts readings" later, now i need to fix the password bug, and again: THIS IS SO NOT A GF SCRIPT EDIT OR SOMETHING.


EDIT: And OnPlayerLogin is not about saving -_-


Re: Password is right but says it's not ??? - 0ne - 03.05.2010

help.?