Auto saving problem
#1

I'm making an auto-saving stats with timers. So the problem is, I can't overwrite the file. it creates another new line in the same file.

Код:
AdminLevel = 0  <----------- Admin level
VIP = 0 <---------------- VIP
Scores = 0
Money = 0
Kills = 0
Deaths = 1
KDRatio = 0
Hours = 0
Minutes = 0
Seconds = 45
[Stats]
Password = E44D5A32A62A72D4485C973D104C37275AD721858752B9995B8101F866399EB2B641CA96B22B474CD2D8BCDF253911E859D9E7C8180440E7C761698930678212
AdminLevel = 0 <----------- Admin level
VIP = 0 <--------------- VIP
Scores = 0
Money = 0
Kills = 0
Deaths = 0
KDRatio = 0
Hours = 0
Minutes = 0
Seconds = 0
Same..


Here's how I save the stats
pawn Код:
public stats1(playerid)
{
    if(fexist(Path(playerid)))
    {
        new INI:file = INI_Open(Path(playerid));
        INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlvl]);
        INI_WriteInt(file,"VIP",pInfo[playerid][VIP]);
        INI_WriteInt(file,"Scores",pInfo[playerid][Scores]);
        INI_WriteInt(file,"Money",pInfo[playerid][Money]);
        INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);
        INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);
        INI_WriteInt(file,"KDRatio",pInfo[playerid][KDRatio]);
        INI_WriteInt(file,"Hours",pInfo[playerid][Hours]);
        INI_WriteInt(file,"Minutes",pInfo[playerid][Mins]);
        INI_WriteInt(file,"Seconds",pInfo[playerid][Secs]);
        INI_Close(file);
        SendClientMessage(playerid,green,"Stats saved!"); // will be removed...
        return 1;
    }
    return 1;
}
Reply
#2

set the tag name "Stats"
Reply
#3

That doesn't change anything.

EDIT: It works. Thanks.
Reply
#4

i was almost at a loss for words!!


good to see its working
regards,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)