SA-MP Forums Archive
Account Removal Script - 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: Account Removal Script (/showthread.php?tid=323436)



Account Removal Script - Coffeemonster - 05.03.2012

I came up with an idea of automatically removing inactive accounts from the scriptfiles accounts folder, for example automatically delete the file if they are inactive for example 2 weeks.

Now that I wonder, is it actually possible to script? I am using an y_ini filesaving in my gamemode, and I have no idea if it would be possible, the reason I want to do this is to prevent huge sizes and keep a track who actually plays.

If it isn't possible to actually automatically remove the file, would it then be possible to add something what tells somewhere that account x has been inactive for x days?

- Coffeemonster.


Re: Account Removal Script - R0FLC0PTER - 05.03.2012

Well it's possible, you will have to periodically loop through all the accounts, and check if the last login time was more then 2 weeks ago.


Re: Account Removal Script - Coffeemonster - 06.03.2012

Right, I'm not the best scripter around so any chance of an example?


Re: Account Removal Script - Shabi RoxX - 06.03.2012

Create a variables to save date. Now Save date(dd,mm,yy) on player login.....

Now create a function to check date of login of each player and current date , then calculate time of last login and delplayer file ?


Re: Account Removal Script - Vince - 06.03.2012

Like I already said in other topics: it is hard to nearly impossible to check every file, as you will either need a file index (e.g. 1.ini) or a file that contains all file names (fileception ). You then need to open, check and close each file separately (can run into 1000+ accounts) which will lag your server for sure. MySQL is built to quickly do this kind of a stuff.


Re: Account Removal Script - Coffeemonster - 06.03.2012

Quote:
Originally Posted by Vince
Посмотреть сообщение
Like I already said in other topics: it is hard to nearly impossible to check every file, as you will either need a file index (e.g. 1.ini) or a file that contains all file names (fileception ). You then need to open, check and close each file separately (can run into 1000+ accounts) which will lag your server for sure. MySQL is built to quickly do this kind of a stuff.
Thank you for the information, I've thought about MySQL database for my accounts and stuff, but it would be a pain in the ass to convert everything and I honestly don't know much about SQL so I would probably do alot of mistakes what would then cause security issues.
If you ofcourse have any good sources or tutorials about MySQL databases and securing them properly with SA-MP then I'd be glad.