Raised This Month: $ Target: $400
 0% 

help. Part of a code to another


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
jg_20
Senior Member
Join Date: Oct 2011
Old 04-20-2012 , 16:33   help. Part of a code to another
Reply With Quote #1

Hello

I could help put the code of another?

This code

PHP Code:

LoadMapFile
( const szFile[] )
{
    new 
szText256 ] , iFile;
    
    
iFile fopenszFile "rt" );
    
    while( ( 
g_iVoteMapCount < ( g_iVoteMaps get_pcvar_numg_pVoteMaps ) ) ) && !feofiFile ) && fgetsiFile szText charsmaxszText ) ) )
    {
        
trimszText );
        
        if( ( ( 
szText] == '^0' ) || ( szText] == '/' ) || ( szText] == ';' ) ) || !is_map_validszText ) ) 
            continue;

        
copyg_szVoteMapsg_iVoteMapCount ] , charsmaxg_szVoteMaps[] ) , szText );

        
g_iMapVotesg_iVoteMapCount ][ MapIndex ] = g_iVoteMapCount++;

        
menu_additemg_iVoteMenu szText )
    }
    
    
fcloseiFile );

Oh this code

PHP Code:


public load_votemap_menu(filename[])
{
    new 
szText[20][ 256 ] , iFile;
   
    
iFile fopenfilename "rt" );
   
    
pug_votemap_count 0;
   
    while( ( 
pug_votemap_count VoteMaps ) && !feofiFile ) && fgetsiFile szText[pug_votemap_count] , 255 ) )
    {
        
trimszText[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)
        {
                
copypug_votemap_name] , charsmaxpug_votemap_name[] ) , szText[o] );
                
menu_additempug_votemap_menu szText[o] )
                
active[o] = true;
                
g_iMapVotes][ 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" ); 
 
    
fcloseiFile );

And this is what I and miss but I get bad

PHP Code:

public load_votemap_menu(filename[])
{
    new 
szText[20][ 256 ] , iFile;
   
    
iFile fopenfilename "rt" );
   
    while( ( 
pug_votemap_count VoteMaps ) && !feofiFile ) && fgetsiFile szText[pug_votemap_count] , 255 ) ) 
    {
        
trimszText[pug_votemap_count] );
       
        if( ( ( 
szText[pug_votemap_count][ ] == '^0' ) || ( szText[pug_votemap_count][ ] == '/' ) || ( szText[pug_votemap_count][ ] == ';' ) ) || !is_map_validszText[pug_votemap_count] ) )
            continue;
 
        
pug_votemap_count++
    }
    
pug_votemap_menu menu_create("Vote Map:","votemap_handle");
    new 
i,o,bool:active[20]
    do
        {
                
copypug_votemap_name] , charsmaxpug_votemap_name[] ) , szText[o] ); 
                
menu_additempug_votemap_menu szText[o] )
                
active[o] = true;
                
g_iMapVotes][ MapIndex ] = i++;
        }
    }
    while(
i<pug_votemap_count)
    
menu_setprop(pug_votemap_menu,MPROP_EXIT,MEXIT_NEVER)

 
    
fcloseiFile );

In Figure 1 is how it should display.

And in Figure 2 is how I get to my place trying. : S
Attached Thumbnails
Click image for larger version

Name:	PPPPPPPPP.JPG
Views:	92
Size:	38.9 KB
ID:	102446   Click image for larger version

Name:	2012-04-17_00001.jpg
Views:	90
Size:	34.5 KB
ID:	102447  

Last edited by jg_20; 10-28-2012 at 03:28.
jg_20 is offline
Send a message via Skype™ to jg_20
 



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 07:45.


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