Passwords aren't saving upon registering/logging in.
#2

Try this:

pawn Код:
if(dialogid == DIALOG_REGISTER)
{
    if(response)
    {
        if(!strlen(inputtext))
        {
            format(dr1, sizeof(dr1), "Welcome to ---, %s.", plname);
            ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD , dr1, "This account isn't registered yet. If you wish to contiune, you must register by putting in a password.", "Register", "Leave");
            return 1;
        }
        GetPlayerName(playerid, plname, sizeof(plname));
        format(string, sizeof(string), "\users\%s.ini", plname);
        if(fexist(string))
        {
            new File:hFile = fopen(string, io_write); //Append is for adding something
            //new passw = strval( inputtext ); //strval returns an integer, password should be a string. Just use inputtext
            new var[32];//Make sure the password isnt longer than 23 characters
            format(var, 32, "pPass=%s\n", inputtext);fwrite(hFile, var);
            format(var, 32, "pAdmin=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
            format(var, 32, "pSex=%d\n",PlayerInfo[playerid][pSex]);fwrite(hFile, var);
            format(var, 32, "pSupporter=%d\n",PlayerInfo[playerid][pSupporter]);fwrite(hFile, var);
            format(var, 32, "pCash=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
            format(var, 32, "pAge=%d\n",PlayerInfo[playerid][pAge]);fwrite(hFile, var);
            format(var, 32, "pLevel=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
            format(var, 32, "pTut=%d\n",PlayerInfo[playerid][pTut]);fwrite(hFile, var);
            format(var, 32, "pRace=%d\n",PlayerInfo[playerid][pRace]);fwrite(hFile, var);
            fclose(hFile);
            gPlayerAccount[playerid] = 1;
            AntiHack(playerid, 1500);
            SendClientMessage(playerid, COLOR_YELLOW, "Registered, we'll now send you towards the tutorial.");
            Tutorial(playerid);
            OnPlayerLogin(playerid,inputtext);
        }
        else {} //Account does on exist
    }
    else
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "You have left the server..");
        Kick(playerid);
    }
}
Reply


Messages In This Thread
Passwords aren't saving upon registering/logging in. - by iLcke - 26.09.2012, 10:23
Re: Passwords aren't saving upon registering/logging in. - by Rimeau - 26.09.2012, 10:34
Re: Passwords aren't saving upon registering/logging in. - by iLcke - 26.09.2012, 10:59
Re: Passwords aren't saving upon registering/logging in. - by Rimeau - 26.09.2012, 11:27
Re: Passwords aren't saving upon registering/logging in. - by BrandyPenguin - 26.09.2012, 11:31

Forum Jump:


Users browsing this thread: 1 Guest(s)