help. Part of a code to another
2 Attachment(s)
Hello
I could help put the code of another?
This code
PHP Code:
LoadMapFile( const szFile[] ) { new szText[ 256 ] , iFile; iFile = fopen( szFile , "rt" ); while( ( g_iVoteMapCount < ( g_iVoteMaps = get_pcvar_num( g_pVoteMaps ) ) ) && !feof( iFile ) && fgets( iFile , szText , charsmax( szText ) ) ) { trim( szText ); if( ( ( szText[ 0 ] == '^0' ) || ( szText[ 0 ] == '/' ) || ( szText[ 0 ] == ';' ) ) || !is_map_valid( szText ) ) continue;
copy( g_szVoteMaps[ g_iVoteMapCount ] , charsmax( g_szVoteMaps[] ) , szText );
g_iMapVotes[ g_iVoteMapCount ][ MapIndex ] = g_iVoteMapCount++;
menu_additem( g_iVoteMenu , szText ) } fclose( iFile ); }
Oh this code
PHP Code:
public load_votemap_menu(filename[]) { new szText[20][ 256 ] , iFile; iFile = fopen( filename , "rt" ); pug_votemap_count = 0; while( ( pug_votemap_count < VoteMaps ) && !feof( iFile ) && fgets( iFile , szText[pug_votemap_count] , 255 ) ) { trim( szText[pug_votemap_count] );
pug_votemap_count++ } pug_votemap_menu = menu_create("Vote Map:","votemap_handle"); new i,o,bool:active[20] do { o=random_num(0,pug_votemap_count-1) if(!active[o] && random_num(0,2)==1) { copy( pug_votemap_name[ i ] , charsmax( pug_votemap_name[] ) , szText[o] ); menu_additem( pug_votemap_menu , szText[o] ) active[o] = true; g_iMapVotes[ i ][ MapIndex ] = i++; } } while(i<pug_votemap_count) menu_setprop(pug_votemap_menu,MPROP_EXIT,MEXIT_NEVER) menu_setprop(pug_votemap_menu,MPROP_NUMBER_COLOR , "\w" ); fclose( iFile ); }
And this is what I and miss but I get bad
PHP Code:
public load_votemap_menu(filename[]) { new szText[20][ 256 ] , iFile; iFile = fopen( filename , "rt" ); while( ( pug_votemap_count < VoteMaps ) && !feof( iFile ) && fgets( iFile , szText[pug_votemap_count] , 255 ) ) { trim( szText[pug_votemap_count] ); if( ( ( szText[pug_votemap_count][ 0 ] == '^0' ) || ( szText[pug_votemap_count][ 0 ] == '/' ) || ( szText[pug_votemap_count][ 0 ] == ';' ) ) || !is_map_valid( szText[pug_votemap_count] ) ) continue; pug_votemap_count++ } pug_votemap_menu = menu_create("Vote Map:","votemap_handle"); new i,o,bool:active[20] do { copy( pug_votemap_name[ i ] , charsmax( pug_votemap_name[] ) , szText[o] ); menu_additem( pug_votemap_menu , szText[o] ) active[o] = true; g_iMapVotes[ i ][ MapIndex ] = i++; } } while(i<pug_votemap_count) menu_setprop(pug_votemap_menu,MPROP_EXIT,MEXIT_NEVER)
fclose( iFile ); }
In Figure 1 is how it should display.
And in Figure 2 is how I get to my place trying. : S
|