Raised This Month: $ Target: $400
 0% 

Select/Copy random maps from a file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 06-19-2012 , 17:13   Select/Copy random maps from a file
Reply With Quote #1

I have this code
PHP Code:
LoadMapFile( const szFile[] )
{
    new 
szBuffer256 ], iFile
    
    iFile 
fopenszFile"rt" )
    
    new 
iVoteMapCount
    
    
while( iVoteMapCount MAX_VOTE_MAPS && !feofiFile ) && fgetsiFileszBuffercharsmaxszBuffer ) ) )
    {
        
trimszBuffer )
        
        if( ( ( 
szBuffer] == '^0' ) || ( szBuffer] == '/' ) || ( szBuffer] == ';' ) ) || !is_map_validszBuffer ) ) 
            continue
        
        
copyg_szVoteMapsiVoteMapCount ], charsmaxg_szVoteMaps[] ), szBuffer )
        
        
g_iMapVotesiVoteMapCount ][ e_MapIndex ] = iVoteMapCount++
        
        
menu_additemg_iVoteMenuszBuffer )
    }
    
    
fcloseiFile )

How to add (menu: copy( g_szVoteMaps .. ) | id: g_iMapVotes[ iVoteMapCount ][ e_MapIndex ]) to select random maps from a file (szFile[]) ?

Like: g_iMapVotes[ iVoteMapCount ][ e_MapIndex ] = random_num( 0, iVoteMapCount++ - 1 ), but I don't know how to update the right name in a menu (menu: copy( g_szVoteMaps .. ).

Last edited by dFF; 06-19-2012 at 17:14.
dFF 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 06:16.


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