Menu bug
Hey i have problems with my dynamic menu...
It works fine if i have so many items that i have more than 1 page but if i have only 3 items, i add blanks with menu_addblank(menu,1); to have a fixed option on place 7. But the value of place 7 is then -3 (MENU_EXIT) It's only when theres only one page... |
Re: Menu bug
Show us your code.
|
Re: Menu bug
Sorry forgot the code Oo
//Not so clean, i know, it's quite old code PHP Code:
Btw its working fine if i'm not adding the blanks |
Re: Menu bug
The reason is that you're using menu_addblank() with slot set to 0. This causes it to not increase the number of total slots, so 7 is beyond the range of the menu. If you have 5 items and 2 blanks (with slot=0), then your total range is 5.
Also, your range starts at 0. So if you have 5 items, keys 0-4 are valid but 5 is not. It is similar to arrays. |
Re: Menu bug
Yes, i think understand your point but i don't think its my problem because if i'm not using menu_addblank(slot=0), it is the same...
To fill the menu up im using addblank with slot=1 so at number 7 in the menu is my fixed menu item (not id 7) Sorry if i misunterstood smth |
Re: Menu bug
PHP Code:
PHP Code:
|
Re: Menu bug
I uncommented the statements for testing
cause the blanks with no slot are just for the look |
Re: Menu bug
I want to help you, but your code doesn't make any sense and it's difficult to follow. It would also help if you explained what exactly you're trying to do.
|
Re: Menu bug
So heres the full code of the function, i thought it is not needed but here
PHP Code:
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 |
Re: Menu bug
So, it's like the banmenu that comes with AMX Mod X. It might be easier to do with original style menu.
|
| All times are GMT -4. The time now is 17:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.