Password is right but says it's not ???
#1

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?
Reply
#2

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

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!
Reply
#4

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!
Reply
#5

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 -_-
Reply
#6

help.?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)