Creating an empty file
#1

Well I don't really know how to explain this, but I was making a new gamemode.
I started off with making a registration system, but I found a bug.

If I click on "Quit" before registering, for some reason it's creating the .ini file, but empty.
And that would stop me from registering, and will ask me to login.

pawn Код:
case DIALOG_REGISTER:
{
    if(!response)
        return Kick(playerid);

    if(response)
    {
        if(strlen(inputtext) < 3 || strlen(inputtext) > 32)
            return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registering...", "Welcome to the server!\nPlease enter a password to register.\n\n{FF0000}The password must be between 3 and 32 characters.", "Register", "Quit");

        new hashedpass[129];
        WP_Hash(hashedpass, sizeof (hashedpass), inputtext);
       
        new INI:file = INI_Open(UserPath(playerid));
        INI_WriteString(file, "Password", hashedpass);
        INI_WriteInt(file, "Admin", 0);
        INI_WriteInt(file, "Money", 0);
        INI_WriteInt(file, "Score", 0);
        INI_WriteInt(file, "Kills", 0);
        INI_WriteInt(file, "Deaths", 0);
        INI_Close(file);
   
        // Rest of the code
   
    }
}
Reply


Messages In This Thread
[Y_INI Registration] Creating empty files - by Stinged - 22.06.2014, 09:06
Re: Creating an empty file - by Lordzy - 22.06.2014, 09:11
Re: Creating an empty file - by Stinged - 22.06.2014, 09:19
Re: Creating an empty file - by Stinged - 23.06.2014, 05:55
Re: Creating an empty file - by Threshold - 23.06.2014, 06:05
Re: Creating an empty file - by Stinged - 23.06.2014, 06:16
Re: Creating an empty file - by Threshold - 23.06.2014, 06:18
Re: Creating an empty file - by Juvanii - 23.06.2014, 08:22
Re: Creating an empty file - by Stinged - 23.06.2014, 11:34
Re: Creating an empty file - by Threshold - 23.06.2014, 11:47

Forum Jump:


Users browsing this thread: 1 Guest(s)