Saving system
#1

So that's another Issue I have, The admin level perfectly saves!

Now my points, score, kills,deaths won't save inside the ini file

Here's on player disconnect callback code

Код:
    if(fexist(Path(playerid)))//Will check if the file is exit or not inside of User's folder that we have created.
    {
        new INI:file = INI_Open(Path(playerid)); //will open their file
        INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
        INI_WriteInt(file,"Admin", pInfo[playerid][Admin]); //If you've set his/her admin level, then his/her admin level will be saved inside of his/her account
        INI_WriteInt(file,"Money",GetPlayerMoney(playerid));
        INI_WriteInt(file,"Score",GetPlayerScore(playerid));
        INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);
        INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);
        INI_WriteInt(file,"Points",pInfo[playerid][Points]);
        INI_Close(file);
        return 1;
    }
 	InArena1[playerid] = 0;
    return 1;
}
and loadaccount

Код:
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


Messages In This Thread
Saving system - by ivndosos - 26.01.2018, 18:25
Re: Saving system - by Fratello - 26.01.2018, 19:24
Re: Saving system - by ivndosos - 26.01.2018, 19:46
Re: Saving system - by Fratello - 26.01.2018, 19:56
Re: Saving system - by ivndosos - 26.01.2018, 20:09
Re: Saving system - by ivndosos - 27.01.2018, 14:17
Re: Saving system - by CodeStyle175 - 27.01.2018, 16:39
Re: Saving system - by ivndosos - 27.01.2018, 17:23
Re: Saving system - by Wanheda - 27.01.2018, 19:31
Re: Saving system - by severance - 27.01.2018, 20:12

Forum Jump:


Users browsing this thread: 1 Guest(s)