Looping through files
#1

Basically, I need to make it update a variable every month (The timer to check that is in my server already) and go through all the file names. I use DJson (Dini2) for my saving. I can easily do this with my Businesses because they save at Biz - %d so I can just do a loop but, With files I cant because they same as Player Name.djson, I need to find a way to do exactly what I would do with the Business for the Player Files without using numbers.

I know that may have come across a bit confusing but, Please try to help if you can. Thanks.
Reply
#2

you must use a plugin or..
make a very recource hungry script but it will take forever to loop all files..
Reply
#3

It only happens once a month so it isn't a big deal that the server might hang temporarily and I don't know if any plugins like that or scripts thats why I'm asking. I know SQL would be a better alternative but, Its only for one thing.
Reply
#4

download the ysf plugin and use ffind
pawn Код:
new filename[32], j;
while(ffind("*.ini", filename, 64, j))
{
    //do stuff
}
Reply
#5

Thank you very much!

I will try this and report back.
Reply
#6

It didn't actually work but, I had problems getting it to run with the new version of SAMP as it is, Any suggestions?
Reply
#7

I don't know if there is a function, or you need the players name to use his/her file.

Best way to go about it is: When the player registers, save his/her name, along with the other registered users names in a .txt. When you want to check all the files, search each line, take the user name and use it to get the file.

-Conroy
Reply
#8

Couldn't there be a way to just get the ffind part of the YSF plugin to work in Pawn somehow so that it could just be put into my Gamemode?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)