24.02.2015, 19:35
It's hard to create such a system, especially because default samp functions don't even allow you to list all files in a directory.
So, basically, there is no way to open all account-files one-by-one and reading them until you find the IP in each file.
There is a plugin which could do this, but if you have thousands of players (and thousands accounts), opening/reading/closing them all is way too slow and will lag your server badly.
The best way would be to use MySQL.
One simple query could get all the info you need without even lagging the server as you can use threaded queries.
Reading files isn't threaded and your script has to wait execution of everything else until the file-reading has finished (in case of thousands of accounts, this may take several seconds, if not dozens of seconds, or even minutes, even with a fast harddrive).
So, basically, there is no way to open all account-files one-by-one and reading them until you find the IP in each file.
There is a plugin which could do this, but if you have thousands of players (and thousands accounts), opening/reading/closing them all is way too slow and will lag your server badly.
The best way would be to use MySQL.
One simple query could get all the info you need without even lagging the server as you can use threaded queries.
Reading files isn't threaded and your script has to wait execution of everything else until the file-reading has finished (in case of thousands of accounts, this may take several seconds, if not dozens of seconds, or even minutes, even with a fast harddrive).