AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   generating mapcycle duplicates (https://forums.alliedmods.net/showthread.php?t=93844)

xPaw 06-03-2009 09:00

generating mapcycle duplicates
 
Heya geeks :mrgreen: i did small plugin to generate mapcycle but sometimes it duplicates files :o
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;



Bugsy 06-03-2009 09:09

Re: generating mapcycle duplicates
 
I just ran it and got no dupes:

Code:

aim_akcolt2
aim_dust_final_v2
aim_map
boxwarz
fy_iceworld
fy_pool_day
fy_snow3
surf_ski_2

Do the maps that get duplicated have any similarities?


All times are GMT -4. The time now is 14:02.

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