Combine the menus
Hi There,
I tried to combining the menus together, but my code doesn't work what is the wrong ? Code:
|
Re: Combine the menus
The first thing I notice is that you're using the variable iMenu for two entirely different purposes at the same time which is not possible. Your menu type and the menu pointer used with the menu_*() functions cannot use the same variable.
However, the first question that you should ask yourself is, why would you combine these menus if you're not keeping their functionality completely separate (via the menu type) anyways? As it is, without any other reason, it looks like you shouldn't even attempt combining menus like this. If you have some reason to do it, you should explain because that will help us help you get to the best result. Also, MenuTitle() is not an AMX Mod X function, what does it do? |
Re: Combine the menus
Quote:
There's three commands on my plugin using the same style of menu for getting online players why i add same menu three times for three commands and there's way to make one menu for these commands. Quote:
Code:
|
Re: Combine the menus
You have to set and keep track of the the menu type for all players (e.g. in a global variable) which you are not even attempting to do. So, currently the handler doesn't know how to handle a menu item selection. Also, you shouldn't be checking flags in the handler, check them before you show the menu and don't show the menu at all if they don't have access.
Finally, you're printing a message saying "you don't have access" even though you just performed the action. |
Re: Combine the menus
Quote:
Quote:
Code:
|
Re: Combine the menus
Quote:
|
Re: Combine the menus
I want to do this because i see this idea is better for being easy for who want to edit it until i do ini file.
If there some one doesn't have any expriance on scripting and want to edit it will not search between menus, which menu for this command plus fixing hard codding. I saw this idea made before on plugin but i didn't found that plugin, plz if you have any idea how to do this tell me! |
Re: Combine the menus
If you wanted to make it "easy" for beginners (not a good goal) then you would make three completely separate menus. Just implement something that works (you've been given several options) and then you can modify it later.
Even if it is possible to do what you want to do (still not really sure what you're talking about) it will most likely be more complex anyways. |
Re: Combine the menus
pass your menu type to the handler in the item info field along with the userid
|
Re: Combine the menus
Destroy the menu right after retrieving the info there is no need to keep it alive.
Also dont be shy to post the whole code no ones gonna steal anything its not that well coded either. |
| All times are GMT -4. The time now is 02:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.