Help?
#1

So i made this /rename command. It works good but i have one problem. It changes player's name and put it in file where other users are. Problem is it won't delete old account. How can i fix this??
This is my stock frename
PHP код:
stock frename(oldname[], newname[])
{
    if(!
fexist(oldname)) return false;
    
fremove(newname);
    if(!
fcopy(oldnamenewname)) return false;
    
fremove(oldname);
    return 
1;

I don't see problem here, or it is maybe somewhere else\

EDIT: This is stock fcopy
PHP код:
stock fcopy(oldname[], newname[])
{
    new 
File:ohndFile:nhnd;
    if (!
fexist(oldname)) return false;
    
ohnd=fopen(oldname,io_read);
    
nhnd=fopen(newname,io_write);
    new 
buf2[1];
    new 
i;
    for (
i=flength(ohnd);i>0;i--)
    {
        
fputchar(nhndfgetchar(ohndbuf2[0],false),false);
    }
    
fclose(ohnd);
    
fclose(nhnd);
    return 
true;

Reply


Messages In This Thread
Help? - by Micko123 - 08.06.2016, 21:06
Re: Help? - by J0sh... - 08.06.2016, 21:27
Re: Help? - by Micko123 - 08.06.2016, 21:29
Re: Help? - by J0sh... - 08.06.2016, 21:33
Re: Help? - by Micko123 - 08.06.2016, 21:35
Re: Help? - by J0sh... - 08.06.2016, 21:36
Re: Help? - by Micko123 - 08.06.2016, 21:38
Re: Help? - by Dayrion - 09.06.2016, 05:01
Re: Help? - by Micko123 - 09.06.2016, 06:16

Forum Jump:


Users browsing this thread: 1 Guest(s)