AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to rename a file ? rename_file isn't working? (https://forums.alliedmods.net/showthread.php?t=159257)

byetovice 06-14-2011 18:48

How to rename a file ? rename_file isn't working?
 
Code:

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
        new oldfile[] = "addons/amxmodx/abc.ini"
        new newfile[] = "addons/amxmodx/xyz.ini"
        rename_file(oldfile, newfile)
}

Help me, its not working. Why ?

Exolent[jNr] 06-14-2011 20:25

Re: How to rename a file ? rename_file isn't working?
 
No read/write permissions on the server?

Dolph_Ziggler 06-15-2011 07:01

Re: How to rename a file ? rename_file isn't working?
 
Code:

new oldfile[] = "addons/amxmodx/abc.ini"
new newfile[] = "addons/amxmodx/xyz.ini"

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
        rename_file(oldfile, newfile)
}

maybe like that ?

drekes 06-15-2011 09:19

Re: How to rename a file ? rename_file isn't working?
 
Quote:

Originally Posted by Dolph_Ziggler (Post 1488614)
Code:

new oldfile[] = "addons/amxmodx/abc.ini"
new newfile[] = "addons/amxmodx/xyz.ini"

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    rename_file(oldfile, newfile)
}

maybe like that ?

Doesn't matter. The problem is that it can't rename the file, probably because of permission settings like Exolent said. I had the same problem before with deleting a file.

byetovice 06-15-2011 11:21

Re: How to rename a file ? rename_file isn't working?
 
:) I solved it.
Code:

rename_file(oldfile, newfile, 1)
its working perfect.


All times are GMT -4. The time now is 23:32.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.