Raised This Month: $ Target: $400
 0% 

Menu bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
uxMal
Member
Join Date: Oct 2007
Old 10-22-2009 , 18:32   Re: Menu bug
Reply With Quote #1

So heres the full code of the function, i thought it is not needed but here
PHP Code:
public adminmenu(id,type,page
{
    if(
get_playersnum() <= 1)
    {
        
client_printc(id,id,"\g[Mute++] \o%L",LANG_PLAYER,"NOT_ENOUGH_PLAYER");
        return;
    }
    new 
usr;
    if((
get_user_flags(id) & ADMIN_MUTE_LVL) && !gMode[id]) usr 1;
    new 
menu menu_create((usr "\rAdmin Mute Menu" "\rMute Menu"), "mute_handler");
    
    
    new 
count=0;
    for(new 
0<= MAXPLAYERSi++)
    {
        if(
count == 6)
        {
            
menu_addblank(menu,0);
            new 
choice[32],msg[4],info[5];
            
formatex(info,4,"133%d",type)
            
formatex(msg,3,"M_%d",type);
            
formatex(choice,31,"\y%L",LANG_PLAYER,msg);
            if(
types[id] == 0types[id] = 1;
            
menu_additem(menu,choice,info,0,-1);
            
count 0;
        }
        if(
is_user_connected(i) && !(get_user_flags(i) & ADMIN_NOBLOCK_LVL) && id != i)
        {
            new 
buffer[37],ind[4];
            
get_user_name(i,buffer,30);
            switch((
usr states[i] : usrstate[id][i])) 
            {
                case 
1:
                {
                    
format(buffer,36,"%s   \rV",buffer);
                }
                case 
2:
                {
                    
format(buffer,36,"%s   \rC",buffer);
                }
                case 
3:
                {
                    
format(buffer,36,"%s   \rV C",buffer);
                }
                
            }
            
formatex(ind,3,"%d",i);
            
menu_additem(menu,buffer,ind,0,-1);
            
count++;
        }
        
        
        
    }
    if(
count != 0
    {
        for(new 
count;6;i++)
        {
            
menu_addblank(menu,1);    
        }
        
        
menu_addblank(menu,0);
        new 
choice[32],msg[4],info[5];
        
formatex(info,4,"133%d",type)
        
formatex(msg,3,"M_%d",type);
        
formatex(choice,31,"\y%L",LANG_PLAYER,msg);
        if(
types[id] == 0types[id] = 1;
        
menu_additem(menu,choice,info,0,-1);
        
count 0;
    }
    
    
menu_display(id,menu,page);

This function does the following it creates a menu with all players in it.

on one page slot 1-6 are players slot 7 is mute voice/chat and the other 3 are forward, back and exit

It is for a mute plugin, if you select slot 7 it switches from mute chat to mute voice and vice versa.

The count variable saves the number of player currently on one page because the structure is as said above
1-6 players
7 mute chat / mute voice
blank without slot
8-10 back, forward, exit

I hope this helped you unterstand the code better
uxMal is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-22-2009 , 19:21   Re: Menu bug
Reply With Quote #2

So, it's like the banmenu that comes with AMX Mod X. It might be easier to do with original style menu.
__________________
fysiks is offline
uxMal
Member
Join Date: Oct 2007
Old 10-23-2009 , 05:31   Re: Menu bug
Reply With Quote #3

Maybe...

But it works if i leave out the addblanks, so i think there must be something bugged
uxMal is offline
Reply



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 17:34.


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