AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Deleting files @ mapchange (https://forums.alliedmods.net/showthread.php?t=57232)

crayz 07-01-2007 02:02

Deleting files @ mapchange
 
Hello, I would like to create a plugin that will delete the files I specify @ mapchange.

But I have no clue how.

I need to delete 2 files from the vault folder.

I have no amxx scripting experience whatsoever.

Thanks!

Drak 07-01-2007 03:29

Re: Deleting files @ mapchange
 
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "Drak" new g_baseDir[128] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         get_basedir(g_baseDir,127); } public plugin_end() {     format(g_baseDir,127,"%s/data/vault.ini",g_baseDir);     delete_file(g_baseDir); }

What file(s) do you need to delete?
The code above deletes the 'vault.ini' file (just for an example)

Also, does anyone know a proper way to detect when the map changes?
( I assume plugin_end is called on map change )


All times are GMT -4. The time now is 21:33.

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