SA-MP Forums Archive
changename cmd y_ini system problem - 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)
+--- Thread: changename cmd y_ini system problem (/showthread.php?tid=508041)



changename cmd y_ini system problem - lonalovegood1 - 20.04.2014

I Want to make a cmd with zcmd to change players name
and i want it to move all players data to a new file ...
i want that to save money , score and ... in new profile
actually i want to know how can i do something to change a y_ini file Name ! ( User Profile )


Re: changename cmd y_ini system problem - SyntaxQ - 20.04.2014

I use this in my script, I found this in another script (I don't remember the name):
pawn Код:
stock frename(oldname[], newname[])
{
    if (!fexist(oldname)) return 0;
    new File:oldfile = fopen(oldname, io_read);
    new File:newfile = fopen(newname, io_write);
    new line[256];
    while (fread(oldfile, line))
    {
        fwrite(newfile, line);
    }
    fclose(oldfile);
    fclose(newfile);
    fremove(oldname);
    return 1;
}
It will remove the previous file and copy the content to a new one.