搜索
查看: 2637|回复: 5

使用插件是否可以更改某一个文件的文件名字?

[复制链接]
发表于 2009-3-31 20:50:18 | 显示全部楼层 |阅读模式 来自 日本
本帖最后由 cityhonghu 于 2009-3-31 20:53 编辑

如题,使用插件是否可以实现更改addons\amxmodx\configs目录下的某一文件的文件名吗?

另问,停用插件的方法具体都有哪些呢?
已知方法:amxx pause xxx
发表于 2009-3-31 21:12:46 | 显示全部楼层 来自 广东惠州

  1. /* renames a file.  returns 0 on failure, 1 on success.
  2. * if relative true, rename_file will act like other natives which
  3. * use the moddir as a base directory.  otherwise, the current directory is
  4. * undefined (but assumed to be hlds).
  5. */
  6. native rename_file(const oldname[], const newname[], relative=0);
复制代码
回复

使用道具 举报

 楼主| 发表于 2009-3-31 22:06:12 | 显示全部楼层 来自 日本
太谢谢你了。能不能具体举个例子呢?
比如把test.log改为old.log
回复

使用道具 举报

发表于 2009-4-1 00:01:35 | 显示全部楼层 来自 广东惠州

  1.         new oldfile[64],newfile[64];
  2.        
  3.         get_configsdir(oldfile,63);
  4.         get_configsdir(newfile,63);
  5.        
  6.         formatex(oldfile,63,"%s/44.txt",oldfile);
  7.         formatex(newfile,63,"%s/66.abc",newfile);
  8.        
  9.         rename_file(oldfile,newfile,1);
复制代码
回复

使用道具 举报

 楼主| 发表于 2009-4-1 00:20:09 | 显示全部楼层 来自 日本
楼上的,非常感谢你:victory:
回复

使用道具 举报

发表于 2010-5-2 20:54:52 | 显示全部楼层 来自 重庆
学到不少
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表