Loop through all user files
#1

Hey, i want to make a command to check whos in your faction, including the offline members, so can someone explain me how to make a loop through all user files? Im using Dini... Unfortunately.

Thanks in advance.
Reply
#2

You can't. The only way you could loop though them is if they were numbered (1.ini 2.ini...).
Reply
#3

Use y_files, or name files with an auto increment integer. There is no native way to loop through files unless you know the names of them before hand.
Reply
#4

If you were using MySQL you'd be able to but as the others have said, with a file based script, there isn't a practical way.
Reply
#5

Or you can create an .ini file and store faction member's names inside, then you can use fread to fetch the data.

https://sampwiki.blast.hk/wiki/fread
https://sampwiki.blast.hk/wiki/fopen
https://sampwiki.blast.hk/wiki/fwrite
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)