saves twice
#1

Hello there.

I am currently using y_ini on my register and login system, but I am having a few troubles.
Some stats save twice like this:

pawn Код:
[Player's Data]
Password = 100D970E0FC7FC9BE9AF59C8216EF5CF4FA5343976F085B06CA2EA4ECA09DBF11115222B324DE456917FBBE55D7916E6D1021B76FC34B2666233E30D07A6BC6C
Admin = 0
Donator = 0
Money = 1000
Bank Balance = 3000
Level = 1
Kills = 0
Deaths = 0
Skin = 299
Health = 100.000000
Armor = 0.000000
PosX = 1779.671752
PosY = -1927.208374
PosZ = 13.389076
Faction = 0
Faction Rank = 0
Job = 0
Job Skill 1 = 0
Job Skill 2 = 0
Banned = 0
IP = 255.255.255.255
Admin Name =
Bank Balance = 0
Faction Rank = 0
Job Skill 1 = 0
Job Skill 2 = 0
Код:
Job Skill 1 = 0
Job Skill 2 = 0
Banned = 0
IP = 255.255.255.255
Admin Name = 
Bank Balance = 0
Faction Rank = 0
Job Skill 1 = 0
Job Skill 2 = 0
My OnPlayerDisconnect is like this:

pawn Код:
if(fexist(Path(playerid)))//Will check if the file is exit or not inside of User's folder that we have created.
    {
        new Float:PosX, Float:PosY, Float:PosZ;
        GetPlayerPos(playerid, PosX, PosY, PosZ);
        new Float:health, Float:armour;
        GetPlayerHealth(playerid,health);
        GetPlayerArmour(playerid, armour);
        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][pAdmin]); //If you've set his/her admin level, then his/her admin level will be saved inside of his/her account
        INI_WriteString(file,"Admin Name",pInfo[playerid][pAdminName]); //If you've set his/her admin level, then his/her admin level will be saved inside of his/her account
        INI_WriteInt(file,"Donator",pInfo[playerid][pDonator]);//As explained above
        INI_WriteInt(file,"Money",pInfo[playerid][pMoney]);//We will save his money inside of his account
        INI_WriteInt(file,"Bank Balance",pInfo[playerid][pBank]);//We will save his money inside of his account
        INI_WriteInt(file,"Level",pInfo[playerid][pLevel]);//We will save his score inside of his account
        INI_WriteInt(file,"Kills",pInfo[playerid][pKills]);//As explained above
        INI_WriteInt(file,"Deaths",pInfo[playerid][pDeaths]);//As explained above
        INI_WriteInt(file,"Skin",pInfo[playerid][pSkin]);//As explained above
        INI_WriteFloat(file,"Health",health);//As explained above
        INI_WriteFloat(file,"Armor",armour);//As explained above
        INI_WriteFloat(file,"PosX",PosX);
        INI_WriteFloat(file,"PosY",PosY);
        INI_WriteFloat(file,"PosZ",PosZ);
        INI_WriteInt(file,"Faction",pInfo[playerid][pFaction]);//As explained above
        INI_WriteInt(file,"Faction Rank",pInfo[playerid][pFacRank]);//As explained above
        INI_WriteInt(file,"Job",pInfo[playerid][pJob]);//As explained above
        INI_WriteInt(file,"Job Skill 1",pInfo[playerid][pJobSkill1]);// Trucker Skill
        INI_WriteInt(file,"Job Skill 2",pInfo[playerid][pJobSkill2]);//As explained above
        INI_WriteInt(file,"Banned",pInfo[playerid][pBanned]);//As explained above
        new plrIP[16];
        GetPlayerIp(playerid, plrIP, sizeof(plrIP));
        INI_WriteString(file,"IP",plrIP);//As explained above
        INI_Close(file);//Now after we've done saving their data, we now need to close the file
        return 1;
    }
Reply


Messages In This Thread
saves twice - by Why - 22.07.2012, 17:18
Re: saves twice - by Why - 24.07.2012, 14:00

Forum Jump:


Users browsing this thread: 1 Guest(s)