SA-MP Forums Archive
More help with stat saving and reloading - 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: More help with stat saving and reloading (/showthread.php?tid=422268)



More help with stat saving and reloading - arathin - 12.03.2013

Alright guys so I have a /stats command that shows stats only problem is it doesn't update until the player disconnect and reconnects, is there anyway to write the players stats at a certain time or each time they die or kill someone then reload the users file so /stats updates?


Re: More help with stat saving and reloading - Scrillex - 13.03.2013

First of all which saving system you use.. It looks you aren't using y_ini ..


Re: More help with stat saving and reloading - vladi866 - 13.03.2013

you can use a timer which will do the same thing as it does when you disconnect(save the stats).
You can do public and forward. so like after the certain time you decided it to be it would save the stats.. or you can even do an individual save account command that will save the player's account individually to reduce laggs in the server.


Re: More help with stat saving and reloading - arathin - 13.03.2013

I am using y_ini haha


Re: More help with stat saving and reloading - kamzaf - 13.03.2013

stats such as..? can you please show your /stats command.


Re: More help with stat saving and reloading - arathin - 13.03.2013

Our /stats command shows a list of things like your money,vip,admin,score,etc and when you kill someone/die I want it to update your users file and /stats can get the updated one.


Re: More help with stat saving and reloading - kamzaf - 13.03.2013

Quote:
Originally Posted by arathin
Посмотреть сообщение
Our /stats command shows a list of things like your money,vip,admin,score,etc and when you kill someone/die I want it to update your users file and /stats can get the updated one.
Hm basically create a function called SavePlayer(playerid); and in that function save the players stats as same as OnPlayerDisconnect (or however your saving it) Next in OnPlayerDeath, put SavePlayer(playerid); and then on the /stats command in the first line put SavePlayer(playerid);

That should fix your prob.