SA-MP Forums Archive
change a players name - 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: change a players name (/showthread.php?tid=173484)



change a players name - LifeStyle - 02.09.2010

I am making /changenick command. but i don't know how to make his file name change. I am using dini.

I use this code for creating a users file:
Code:
dini_Create(udb_encode(gPlayer[playerid][gName]));



Re: change a players name - LarzI - 02.09.2010

pawn Code:
/**
 *  Renames a file (Source file will be deleted!)
 *  @param   oldname
 *           newname
 */

stock frenametextfile(oldname[],newname[]) {
    if (!fexist(oldname)) return false;
    fremove(newname);
    if (!fcopytextfile(oldname,newname)) return false;
    fremove(oldname);
    return true;
}
Use that. Taken from dutils.inc