25.06.2015, 03:26
pawn Код:
// example SaveToFile("objs.txt","CreateObject(param, param, param, param...);");
stock SaveToFile(path[],text[]){
new File:handle = fopen(path, io_append);
if(handle)
{
new sOut[1024];
format(sOut,1024,"%s\r\n",text);
fwrite(handle,sOut);
fclose(handle);
return 1;
}
return 0;
}
you could use format first for the text[] argument and save that way.
this function will append to the file each time it is called,
if no file is created it will first create it.,