Raised This Month: $ Target: $400
 0% 

Dump files ending with .dem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 07-03-2007 , 14:35   Re: Dump files ending with .dem
Reply With Quote #1

Try this:

Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "stupok69"

#define MAX_FILES 32
#define MAX_FILENAME 64

#define DEM_DIR "."

new dem_files[MAX_FILES][MAX_FILENAME]

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	new buffer[MAX_FILENAME], count
	
	new dh = open_dir(DEM_DIR, buffer, MAX_FILENAME-1)
	
	if(!dh) return PLUGIN_HANDLED
	
	if(containi(buffer, ".dem") != -1)
	{
		dem_files[count] = buffer
		count++
	}
	
	while(next_file(dh, buffer, MAX_FILENAME-1)
	{
		if(containi(buffer, ".dem") != -1)
		{
			if(count < MAX_FILES)
			{
				dem_files[count] = buffer
				count++
			}
			else
			{
				server_print("Too many .dem files!")
				break
			}
		}
	}
	
	close_dir(dh)
}
stupok is offline
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:26.


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