Account Removal Script
#1

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.
Reply
#2

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.
Reply
#3

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

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 ?
Reply
#5

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.
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)