Open all the files in a dir? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Open all the files in a dir? (
/showthread.php?tid=201150)
Open all the files in a dir? -
SimonItaly - 20.12.2010
Hello everyone.
In my server there are a lot of user files and maybe some of them are old users that have an admin rank.
I've already made a manual check cmd (es. /isadmin <Nickname>), but I'd like to do it automatically (like /listadmins), opening the /users directory, open the file and check if the player admin rank is bigger than 0.
Is that possibile? I'm talking about something like "dir" cmd for batch with also file opening.
Thanks in advance
(Sorry any mistake)
Re: Open all the files in a dir? -
SimonItaly - 22.12.2010
48h bump.
Re: Open all the files in a dir? -
Nero_3D - 22.12.2010
In pawno not, for that you need to find or create a plugin with another language
Re: Open all the files in a dir? -
PowerPC603 - 22.12.2010
you could create one extra file: "PlayerList.ini".
In this file, every line holds the name of the datafile (account-file) for every player:
Код:
PowerPC603.ini
CrazyGuy.ini
Spongebob.ini
Read this PlayerList file line by line and open/read/close the file that was listed on that line.
Then, when you reach the end of the file, you've processed all player's datafiles.
When a new player registers himself to your server, add the filename of his account to this PlayerList.ini file.
You can use the command "dir" (in the windows command prompt) to build this file:
Select "Execute..." from your start menu and enter "cmd".
This opens the command prompt.
Changedir to your server's directory.
Then type:
dir /B >> PlayerList.ini
This lists all files without size-info (only the filenames) and adds them all to the PlayerList.ini file.