Auto saving problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Auto saving problem (
/showthread.php?tid=354020)
Auto saving problem -
newbienoob - 25.06.2012
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;
}
Re: Auto saving problem -
Jonny5 - 25.06.2012
set the tag name "Stats"
Re: Auto saving problem -
newbienoob - 25.06.2012
That doesn't change anything.
EDIT: It works. Thanks.
Re: Auto saving problem -
Jonny5 - 25.06.2012
i was almost at a loss for words!!
good to see its working
regards,