20.02.2014, 15:39
No need for a plugin to rename it.
and (from the above example):
pawn Код:
stock frename(const oldname[], const newname[])
{
if (!fexist(oldname)) return 0;
new
File: oldfile = fopen(oldname, io_read),
File: newfile = fopen(newname, io_write),
line[128];
if (!oldfile || !newfile) return 0;
while (fread(oldfile, line)) fwrite(newfile, line);
fclose(oldfile);
fclose(newfile);
fremove(oldname);
return 1;
}
pawn Код:
if (!frename(stringr, another)) return SendClientMessage(playerid, -1, "It couldn't rename the file. Try again!");