SA-MP Forums Archive
Create a file in a place other than scriptfiles - 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: Create a file in a place other than scriptfiles (/showthread.php?tid=91159)



Create a file in a place other than scriptfiles - Yoyoyo - 13.08.2009

Hey guyz. Thanks for clicking!
I am using dini and I made a house system that saves in a file called houses.ini
But when i make the file it creates in scriptfiles folder. That is all fine but with a server that gets up to 80 players daily, it is taking long time to load that file and is causing bugs.

Is it possible to make a new folder called "HousesFiles" and store houses.ini inside that?
If it is please make a code.

Thanks guyz


Re: Create a file in a place other than scriptfiles - Jefff - 13.08.2009

Create w folder in scriptfiles and use this
Код:
format(str,128,"/HousesFiles/%s.ini",nick);
dini_Create(str);



Re: Create a file in a place other than scriptfiles - Yoyoyo - 13.08.2009

I dont want a folder in scriptfiles.
I want it like somewhere else.


Re: Create a file in a place other than scriptfiles - HuRRiCaNe - 13.08.2009

i dont think there is a way to change to other than scriptfiles


Re: Create a file in a place other than scriptfiles - KevKo95 - 13.08.2009

I'm not 100% sure about this but perhaps you can use ".." when referring to a directory to save to. Using ".." means go up a directory.

For example, to refer a folder called HouseFiles in the main server directory:
Код:
format(str,128,"/../HouseFiles/%s.ini",nick);
dini_Create(str);
It works on Windows, like if you type "C:\Program Files\..\Windows", it will go to "C:\Windows". It might work that way too, but I'm not really sure, try it though if you want. It also works on most operating systems, if not all, including Mac OS X: "The world's most advanced useless operating system!"