AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Menus .. Damn Menus (https://forums.alliedmods.net/showthread.php?t=277447)

Depresie 01-09-2016 11:25

[HELP] Menus .. Damn Menus
 
1 Attachment(s)
So, i tried to convert this menu to the new style menu, since i had more than 9 options, and i needed more pages
Now the thing is that i never worked with menus, so im sure i screwed somethings up..
I also found an issue, when i press exit on the second page, it goes to the previous page instead of quiting the menu...

Can anyone please check the code?
Especialy enum, plugint_init and show_menu_admin and the handler menu_admin...

addons_zz 01-09-2016 12:10

Re: [HELP] Menus .. Damn Menus
 
Quote:

Originally Posted by Depresie (Post 2381611)
i never worked with menus

No problem with that, just use a good deputation approach then.

I used them at my plugins. See how that goes for you.

Here you will find my code with it, I marked the lines where I used them (between lines 4.787 and 4.913), they are that DEBUG_LOGGER(...) messages:
https://github.com/addonszz/Galileo/blob/b84166b77b378f33ccfa12fb99ccd0c6a4af239e/scripting/galileo.sma#L4787-L4913

And here, at the last [SPOILER] tag (at the end of the commentary), you will find snippet to copy and paste:
https://forums.alliedmods.net/showpost.php?p=2381358&postcount=7

Depresie 01-09-2016 12:30

Re: [HELP] Menus .. Damn Menus
 
ahm.. sorry, but i have no ideea about the things you just posted...

i converted the old menu to the new menu style and i have these lines and i have no ideea what they are and if they are supposed to be there anymore...
i just want someone to check the throw a look over the code to tell me if i messed up forgot something

PHP Code:

// Admin menu actions 
enum
 
{
     
ACTION_MAKE_NEMESIS 0,
     
ACTION_MAKE_SURVIVOR,
     
ACTION_MAKE_ASSASSIN,
     
ACTION_MAKE_SNIPER,
     
ACTION_MAKE_DRAGON,
     
ACTION_MAKE_NINJA,
     
ACTION_MAKE_TYRANT,
     
ACTION_INFECT_CURE,
     
ACTION_RESPAWN_PLAYER,
     
ACTION_START_GAME_MODE
 
}
 

 
// Menu keys
 
const KEYSMENU MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
 

register_menu
("Admin Menu"KEYSMENU"menu_admin"


wickedd 01-09-2016 12:32

Re: [HELP] Menus .. Damn Menus
 
I suggest you read this again or just copy the basic menu from that thread and use it in your plugin.

Depresie 01-09-2016 14:57

Re: [HELP] Menus .. Damn Menus
 
"i converted the old menu to the new menu style and i have these lines and i have no ideea what they are and if they are supposed to be there anymore...
i just want someone to check the throw a look over the code to tell me if i messed up forgot something"


All times are GMT -4. The time now is 09:32.

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