Raised This Month: $ Target: $400
 0% 

amxx menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
hitmany
Senior Member
Join Date: Jul 2010
Old 07-13-2010 , 11:21   amxx menu
Reply With Quote #1

How to add a menu button Next Back?
Menu takes its name from the race lang_GetRaceName, as I understand.
This old style menu?
PHP Code:
public MENU_ChangeRaceidiRaceXP[MAX_RACES] )
{
    
    new 
szRaceName[MAX_RACES+1][64], iposiKeys 0szMenu[512], szXP[16];

    
// Get our race names
    
for ( 0get_pcvar_numCVAR_wc3_races ); i++ )
    {
        
lang_GetRaceName1idszRaceName[i], 63 );
    }

    
pos += formatexszMenu[pos], 512-pos"%L"id"MENU_SELECT_RACE" );

    
// Then add the experience column
    
if ( get_pcvar_numCVAR_wc3_save_xp ) )
    {
        
pos += formatexszMenu[pos], 512-pos"\R%L^n^n"id"MENU_WORD_EXPERIENCE" );
    }
    else
    {
        
pos += formatexszMenu[pos], 512-pos"^n^n" );
    }

    
// Build the changerace menu (for every race)
    
for ( 0get_pcvar_numCVAR_wc3_races ); i++ )
    {
        
num_to_striRaceXP[i], szXP15 );
        
        
// Add the "Select a Hero" message if necessary
        
if ( == )
        {
            
pos += formatszMenu[pos], 512-pos"%L"id"SELECT_HERO" );
        }
        
        
// User's current race
        
if ( == p_data[id][P_RACE] - )
        {
            
pos += formatexszMenu[pos], 512-pos"\d%d. %s\d\R%s^n"1szRaceName[i], ( (get_pcvar_numCVAR_wc3_save_xp )) ? szXP " " ) );

            
iKeys |= (1<<i);
        }

        
// Race the user wants to change to
        
else if ( == p_data[id][P_CHANGERACE] - )
        {
            
pos += formatexszMenu[pos], 512-pos"\r%d. %s\r\R%s^n"1szRaceName[i], ( (get_pcvar_numCVAR_wc3_save_xp )) ? szXP " " ) );

            
iKeys |= (1<<i);
        }

        
// All other cases
        
else
        {
            
/*
            new iRaceLimit = get_pcvar_num( CVAR_wc3_race_limit );
            new bool:bAllowRace = true;

            if ( iRaceLimit > 0 )
            {
                new iTotal[MAX_RACES];

                // Get how many people are using each race
                new iPlayers[32], iNumPlayers, i, iTarget;
                get_players( iPlayers, iNumPlayers );

                for ( i = 0; i < iNumPlayers; i++ )
                {
                    iTarget = iPlayers[i];

                    if ( iTarget != id && p_data[iTarget][P_RACE] > 0 && p_data[iTarget][P_RACE] <= get_pcvar_num( CVAR_wc3_races ) )
                    {
                        iTotal[p_data[iTarget][P_RACE]]++;
                    }
                }
                
                // Now if we have more races selected than iRaceLimit provides us with, then we need to increase iRaceLimit
                while ( HLPR_TotalUsingRaces( iTotal ) > iRaceLimit * get_playersnum() )
                {
                    iRaceLimit++;
                }

                // Check to see if there was an increase that was necessary
                if ( iRaceLimit > get_pcvar_num( CVAR_wc3_race_limit ) )
                {
                    WC3_Log( true, "Error, increase wc3_race_limit to at least %d", iRaceLimit );
                }

                if ( iTotal[i+1] >= iRaceLimit )
                {
                    bAllowRace = false;

                }
            }*/

            
new bool:bAllowRace true;

            
// Check to see if the user can choose this race (are there too many of this race?)
            
if ( bAllowRace )
            {
                
pos += formatexszMenu[pos], 512-pos"\w%d. %s\y\R%s^n"1szRaceName[i], ( (get_pcvar_numCVAR_wc3_save_xp )) ? szXP " " ) );

                
iKeys |= (1<<i);
            }

            
// If not, display the race, but don't give them a key to press
            
else
            {
                
pos += formatexszMenu[pos], 512-pos"\d%d. %s\y\R%s^n"1szRaceName[i], ( (get_pcvar_numCVAR_wc3_save_xp )) ? szXP " " ) );
            }
        }

    }

    
iKeys |= (1<<i);
    
    
// This is needed so we can make the Auto-Select option "0" if the number of races is 9
    
if ( get_pcvar_numCVAR_wc3_races ) == )
    {
        
= -1;
    }

    
pos += formatszMenu[pos], 512-pos"%L"id"SELECT_RACE_FOOTER");
    
    
// Add a cancel button to the bottom
    
if ( get_pcvar_numCVAR_wc3_races ) != )
    {
        
iKeys |= (1<<9);

        
pos += formatszMenu[pos], 512-pos"^n\w0. %L"id"WORD_CANCEL" );
    }
    
    
// Show the menu to the user!
    
show_menuidiKeysszMenu, -);

    return;

hitmany is offline
 


Thread Tools
Display Modes

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:04.


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