Raised This Month: $ Target: $400
 0% 

Deleting files @ mapchange


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
crayz
AlliedModders Donor
Join Date: Jul 2007
Old 07-01-2007 , 02:02   Deleting files @ mapchange
Reply With Quote #1

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!
crayz is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 07-01-2007 , 03:29   Re: Deleting files @ mapchange
Reply With Quote #2

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 )
__________________
Oh yeah

Last edited by Drak; 07-01-2007 at 04:03.
Drak is offline
Send a message via MSN to Drak
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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