SA-MP Forums Archive
file creation not working - 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: file creation not working (/showthread.php?tid=153013)



file creation not working - DowNlOaD_ - 06.06.2010

pawn Код:
if (fexist(playername(i))) return false;
new File:fhnd;
fhnd=fopen(playername(i),io_write);
if (fhnd) {
fclose(fhnd);
return true;
}
why this code is not working? weird ;/


Re: file creation not working - Stepashka - 06.06.2010

use fwrite(fhnd," ");


Re: file creation not working - DowNlOaD_ - 06.06.2010

yeah but i'm using dini_set later on, so i don't think this line should be added?

//edit: it's not working

//edit2: i uploaded all a_samp into my map, could i do something wrong and damage some function?


Re: file creation not working - DJDhan - 06.06.2010

If you are using dini, you can do something like this under your register command:


Код:
     new file[128];
     new string[128];
     new name[MAX_PLAYER_NAME];
     GetPlayerName(playerid, name, sizeof(name));
     format(file,sizeof(file),"/Accounts/%s.ini",name); // you need a folder "Accounts" in script files
     if(!fexist(file))
     {
	dini_Create(file);
       //your stat saving variables here
     }



Re: file creation not working - DowNlOaD_ - 06.06.2010

i was using dini_Create before but it was not working so i changed it