I have this code
PHP Code:
LoadMapFile( const szFile[] )
{
new szBuffer[ 256 ], iFile
iFile = fopen( szFile, "rt" )
new iVoteMapCount
while( iVoteMapCount < MAX_VOTE_MAPS && !feof( iFile ) && fgets( iFile, szBuffer, charsmax( szBuffer ) ) )
{
trim( szBuffer )
if( ( ( szBuffer[ 0 ] == '^0' ) || ( szBuffer[ 0 ] == '/' ) || ( szBuffer[ 0 ] == ';' ) ) || !is_map_valid( szBuffer ) )
continue
copy( g_szVoteMaps[ iVoteMapCount ], charsmax( g_szVoteMaps[] ), szBuffer )
g_iMapVotes[ iVoteMapCount ][ e_MapIndex ] = iVoteMapCount++
menu_additem( g_iVoteMenu, szBuffer )
}
fclose( iFile )
}
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 .. ).