10.08.2015, 00:08
put this in your script.
pawn Код:
/**
* Copies a textfile (Source file won't be deleted!)
* @param oldname
* newname
*/
stock fcopytextfile(oldname[],newname[]) {
new File:ohnd,File:nhnd;
if (!fexist(oldname)) return false;
ohnd=fopen(oldname,io_read);
nhnd=fopen(newname,io_write);
new tmpres[MAX_STRING];
while (fread(ohnd,tmpres)) {
StripNewLine(tmpres);
format(tmpres,sizeof(tmpres),"%s\r\n",tmpres);
fwrite(nhnd,tmpres);
}
fclose(ohnd);
fclose(nhnd);
return true;
}