Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Saving system

$
0
0
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

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

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;
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>