Raised This Month: $ Target: $400
 0% 

generating mapcycle duplicates


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-03-2009 , 09:00   generating mapcycle duplicates
Reply With Quote #1

Heya geeks i did small plugin to generate mapcycle but sometimes it duplicates files
PHP Code:
#include <amxmodx>

#define ADMIN_LEVEL ADMIN_CVAR
#define MAPFILE "mapcycle.txt"

public plugin_init() {
    
register_plugin"Mapcycle Generator""1.0""xPaw" );
    
    
register_concmd"amx_generate_mapcycle""cmdGenerateMapcycle"ADMIN_LEVEL"Generate mapcycle" );
}

public 
cmdGenerateMapcycleid ) {
    if( 
get_user_flagsid ) & ADMIN_LEVEL ) {
        new 
szFile128 ], iLineiSize charsmaxszFile );
        new 
iDir open_dir"maps"szFileiSize );
        
        if( 
file_existsMAPFILE ) )
            
delete_fileMAPFILE );
        
        do {
            
strtolowerszFile );
            
replaceszFileiSize".bsp""" );
            
            if( ( 
szFile] == 'd' && szFile] == 'e' && szFile] == '_' ) || ( szFile] == 'c' && szFile] == 's' && szFile] == '_' ) || ( szFile] == 'a' && szFile] == 's' && szFile] == '_' ) )
                continue;
            
            if( 
is_map_validszFile ) ) {
                
write_fileMAPFILEszFileiLine );
                
                
iLine++;
            }
        }
        while( 
next_fileiDirszFileiSize ) );
        
        
close_diriDir );
        
        new 
szName32 ], szAuthid32 ];
        
get_user_nameidszNamecharsmaxszName ) );
        
get_user_authididszAuthidcharsmaxszAuthid ) );
        
        
log_amx"Generate mapcycle ^"%s<%d><%s><>^""szNameget_user_useridid ), szAuthid );
        
        
console_printid"Mapcycle has been succesfully generated." );
    } else
        
console_printid"You have no access to that command." );
    
    return 
PLUGIN_HANDLED;

__________________
xPaw is offline
 



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 14:02.


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