Rename a file is not working
#1

Hello, im trying to rename userfiles but it is not renaming anything. I use the "frename" function from YSF plugin. I certainly do not use it directly:

PHP код:

frename
(UserPath(playerid),GetOfflineUserPath(newname)); 
At final, UserPath become: /users/name.ini and Getofflineuserpath : /users/newname.ini

Thanks to help me!
Reply
#2

Here try this:

PHP код:
stock frename2(const path[], const newPath[])
{
    if(!
fexist(path)||fexist(newPath)) return 0;
    new 
File:fopen(path,io_read),buffer[512];
    
fread(f,buffer,sizeof(buffer));
    
fclose(f);
    
fremove(path);
    
fopen(newPath,io_write);
    
fwrite(f,buffer);
    
fclose(f);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)