%s.ini file writes twice!
#1

I'm having this weird issue with my ini file

Code:
AdminLevel = 0
[Player Information]
Deaths = 0
Kills = 0
Score = 0
Money = 0
AdminLevel = 0
Password = 2284011421411A104799568D490F01DAB30240E4248DF1981911B727811D6F4D7EDD2EFCE86963BFE8BC4C6E95438E60CA18C6A8C66DB77873DCE268E28BDB4E
That's an example, Does anyone have idea why does it write it twice?
Reply
#2

Show your code pal.
Reply
#3

Which one though..?
Reply
#4

How do you mean, writes twice? In the example it's single, are you meaning that it's writing 2 files with the same content?
Reply
#5

As you see in my INI file, there are 2 adminlevel text, how do I prevent that?
Reply
#6

You've only provided with a text of your INI configuration file, we need the actual PAWN code of the writing to see the issue. This is an internal issue, not external.
Reply
#7

I'll say it again I guess, Which one? I don't know whats causing this problem..
Reply
#8

It's your code, and what would be the section writing the files, would be the save file function.
Reply
#9

Code:
    if(dialogid == dlogin)
    {//then
        if(!response) return Kick(playerid);
        if(response)
        {//then
            new hashpass[129];
            WP_Hash(hashpass,sizeof(hashpass),inputtext);
            if(!strcmp(hashpass,pInfo[playerid][Pass]))
            {//then
                INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
                SetPlayerScore(playerid,pInfo[playerid][Score]);
                GivePlayerMoney(playerid,pInfo[playerid][Money]);
                SendClientMessage(playerid,-1,"{c3c3c3}(INFO) You have successfully logged in! You can start playing now.");
            }
            else
            {//then
                ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Account","{FF0000}You have entered a wrong password! Please try again.","Login","Quit");//We will tell to them that they've entered an incorrect password
                return 1;
            }
        }
    }
    return 1;
}
Code:
forward loadaccount_user(playerid, name[], value[]);
public loadaccount_user(playerid, name[], value[])
{
    INI_String("Password", pInfo[playerid][Pass],129);
    INI_Int("Admin",pInfo[playerid][Admin]);
    INI_Int("Money",pInfo[playerid][Money]);
    INI_Int("Score",pInfo[playerid][Score]);
    INI_Int("Kills",pInfo[playerid][Kills]);
    INI_Int("Deaths",pInfo[playerid][Deaths]);
    return 1;
}
Reply
#10

Apparently, you've got no common sense within scripting, let me rephrase this: Post your OnPlayerDisconnect callback.


holy fuck this is retarded
Reply
#11

No, post the SAVE function not the LOAD function, and where the LOAD function is used...

We're talking about a file that's being WRITTEN TO, not READ FROM.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)