AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   what's wrong ? (https://forums.alliedmods.net/showthread.php?t=208734)

h3llzOr 02-17-2013 05:26

what's wrong ?
 
hi,
i try to do an an mode with classes, but the menu appear wrong...
picture : http://img841.**************/img841/6082/fysnow0005d.jpg

and code of menu :
PHP Code:

public change_classid )
{
    
    new 
szClassName[MAX_CLASSES+1][64], iposiKeys 0szMenu[512];
    new class[
MAX_CLASSES];

    for ( 
0MAX_CLASSES); i++ )
    {
        
lang_getclassname1idszClassName[i], 63 );
    }

    
pos += formatexszMenu[pos], 512-pos"%L"id"MENU_SELECT_CLASS" );
    
    new 
class_menu=menu_create(szMenu,"_menu_changeclass");

    
pos += formatexszMenu[pos], 512-pos"^n^n" );


    for ( 
0MAX_CLASSESi++ )
    {           
        if ( 
== p_data[id][P_CLASS] - )
        {
            
pos += formatexszMenu[pos], 512-pos"\d%d. %s^n"1szClassName[i] );

            
iKeys |= (1<<i);
        }

        else if ( 
== p_data[id][P_CHANGECLASS] - )
        {
            
pos += formatexszMenu[pos], 512-pos"\r%d. %s^n"1szClassName[i] );

            
iKeys |= (1<<i);
        }
        else
        {
            new 
bool:bAllowRace true;

            if ( 
bAllowRace )
            {
                
pos += formatexszMenu[pos], 512-pos"\w%d. %s^n"1szClassName[i] );

                
iKeys |= (1<<i);
            }
            else
            {
                
pos += formatexszMenu[pos], 512-pos"\d%d. %s^n"1szClassName[i]);
            }
        }
        
        
num_to_str(i, class, 7);
        
menu_additem(class_menu,szMenu,class);

    }

    
iKeys |= (1<<i);

    
menu_setprop(class_menuMPROP_PERPAGE7);
    
menu_setprop(class_menuMPROP_NEXTNAME"Next Page");
    
menu_setprop(class_menuMPROP_BACKNAME"Previous Page");
    
menu_setprop(class_menuMPROP_EXITMEXIT_ALL );

    
menu_display(id,class_menu);
    

    return;
}

public 
_menu_changeclassidmenuitem )
{
    if(
item==MENU_EXIT)
    {
        
menu_destroy(menu);
    }

    new 
iClass;

    if ( 
p_data[id][P_CLASS] != )
    {
        if ( 
iClass != p_data[id][P_CLASS] )
        {
             
client_printidprint_center"%L"id"CENTER_CHANGED_NEXT" );
        }

            
p_data[id][P_CHANGECLASS] = iClass;
        }
        else
        {
            
p_data[id][P_CHANGECLASS] = 0;
        }
    }
    else
    {
        
MW3_SetClassidiClass );
    }

    return 
PLUGIN_HANDLED;



TheDS1337 03-06-2013 12:24

Re: what's wrong ?
 
not needed to use ^n

fysiks 03-07-2013 02:06

Re: what's wrong ?
 
You are trying to mix to different methods of creating menus. Use only one method. Look for the tutorial for "new menus" (which aren't actually "new").


All times are GMT -4. The time now is 21:36.

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