Reading files
#3

Well it's easier to name the files with a number on each of them. Then, when the script loads, you can use a for loop to see if any of the files exist and load them accordingly. Here's what I'm talking about from a house system I started a while ago.

pawn Код:
for(new i; i<MAX_HOME; i++)
{
        if(houseld <= MAX_HOME)
        {
            format(string,22,"%sHouse%d.hou",HOME_PATH,i);
            if(dini_Exists(string))
            {
HOME_PATH was equal to something like '\Homes\' and the MAX_HOME was 100. Then houseld just got incremented as each house was loaded so that you could set a maximum amount of homes loaded. That doesn't really matter though. Just the formatting of the house file name and the checking if it exists.
Reply


Messages In This Thread
Reading files - by yanir3 - 30.05.2011, 05:43
Re: Reading files - by Steven82 - 30.05.2011, 06:14
Re: Reading files - by Backwardsman97 - 30.05.2011, 06:25
Re: Reading files - by [L3th4l] - 30.05.2011, 06:30
Re: Reading files - by yanir3 - 30.05.2011, 06:33
Re: Reading files - by yanir3 - 30.05.2011, 07:31
Re: Reading files - by yanir3 - 30.05.2011, 08:50
Re: Reading files - by yanir3 - 30.05.2011, 10:52
Re: Reading files - by yanir3 - 30.05.2011, 16:31
Re: Reading files - by yanir3 - 31.05.2011, 06:34

Forum Jump:


Users browsing this thread: 1 Guest(s)