Register/Login System Bug
#1

Okay, now on my server when i connect and register, it doesn't save the INI file which its suppose to do so it can save the file, but other than that, when i disconnect from the server the Account's INI file appears on the folder but it doesnt contain the password line, so if i join and write anything in the login dialog box it logs in, so idk whats wrong, but the bug is that it isnt saving my password correctly here are some lines from the script


pawn Код:
if(!strlen(inputtext)) {
                ShowPlayerDialog(playerid, DIALOG_REGISTER_1, DIALOG_STYLE_INPUT, ""COLOR_WHITE"Registering...",""COLOR_RED"You have entered an invalid password.\n"COLOR_WHITE"Type your password below to register a new account.","Register","Quit");
                }

                if(INI_Open(getINI(playerid))) {
                INI_WriteString("Password",inputtext);
                INI_WriteInt("Level",1);
                INI_WriteInt("Money",5000);
                INI_WriteInt("Admin",0);
                INI_WriteInt("Gender",0);
                INI_WriteInt("Age",0);

                INI_Save();
                INI_Close();

pawn Код:
}
public OnPlayerDisconnect(playerid, reason)
{
    if(INI_Open(getINI(playerid))) {

    INI_WriteInt("Level",PlayerInfo[playerid][pLevel]);
    INI_WriteInt("Money",GetPlayerMoney(playerid));
    INI_WriteInt("Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt("Age",PlayerInfo[playerid][pAge]);
    INI_WriteInt("Gender",PlayerInfo[playerid][pGender]);
   

    INI_Save();
    INI_Close();
    }
    return 1;
}
Reply
#2

I thought it worked like this :l
pawn Код:
if(fexist(getINI(playerid)))
{
    new INI:File = INI_Open(getINI(playerid)));
    INI_WriteString(File, "Password", /*HASH YOUR PASSWORDS!!!!!!!*/);
    INI_WriteInt(File, "Level", 1);
    INI_WriteInt(File, "Money", 5000);
    INI_WriteInt(File, "Admin", 0);
    INI_WriteInt(File, "Gender", 0);
    INI_WriteInt(File, "Age", 0);
    INI_Close(File);
}
Reply
#3

I followed this tutorial

https://sampforum.blast.hk/showthread.php?tid=267808

I did excatly what he was doing in the tutorial.
Reply
#4

And that doesn't even use y_ini, it uses SII which is out of date by miles. This tutorial was created in 2011, and the first post even mentions that he is using out of date methods.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)