Raised This Month: $ Target: $400
 0% 

Mapcycle generator (place maps randomly lines)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-05-2009 , 14:02   Re: Mapcycle generator (place maps randomly lines)
Reply With Quote #2

I found a old and basic plugin which does that :

Code:
        stock ShakeMapcyle()     {         new const MapcycleFile[] = "mapcycle.txt";         new Map[ 64 ];         new h = fopen( MapcycleFile, "rb" );                 new Array:SavedMaps = ArrayCreate( 64 );                 while( !feof( h ) )         {             fgets( h, Map, charsmax( Map ) );             trim( Map );             if ( Map[0] )  { ArrayPushString( SavedMaps, Map ); }         }                 fclose( h );         delete_file( MapcycleFile );                 new Cnt;         new MapCnt;         new Rand;         new Rand2;                 Cnt = iMapCnt = ArraySize( SavedMaps );         while( Cnt )         {             Rand  = random( MapCnt );             Rand2 = random( MapCnt );             if( Rand != Rand2 )             {                 ArraySwap( SavedMaps, Rand, Rand2 );                 Cnt--;             }         }                 h = fopen( MapcycleFile, "wb" );                 for( new i; i < MapCnt; ++i )         {               ArrayGetString( SavedMaps, i, Map, charsmax( Map ) );             fputs( h, Map );             fputc( h, '^n' );         }                         fclose( h );         ArrayDestroy( SavedMaps );     }

Put this function in plubin_cfg() for example.
__________________
Arkshine 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 13:52.


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