AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Simple Menu Builder (https://forums.alliedmods.net/showthread.php?t=284324)

Enrory 02-03-2017 12:28

Re: Simple Menu Builder
 
Hello!
I test it on my server.

I see the Item Menus with 1,2,3,... (and Name)
I press the number and the menu is close and do nothing.
Maybe I'll forget something

My .ini
[Menu Settings]
MENU_OPEN = say menu, say_team menu, amx_mymenu

[Menu Items]
"Trails" "say trail menu"
"Glow" "say glow menu"
"Hats" "say /hats"
"Change to Story Server" "say /server"
"wheelchairs?" "say wheelchairs?"
"Player finder" "say .lost"
"Fireworks" "say fireworks"
"Music Player" "say /music"
"Chat sounds off" "say /soundsoff"
"Chat sounds on" "say /soundson"

all other is default.

OciXCrom 02-03-2017 13:37

Re: Simple Menu Builder
 
It works fine for me. Did you add [New menu] before [Menu Settings]?

kristi 02-03-2017 13:55

Re: Simple Menu Builder
 
PHP Code:

"Show Rules" "say /rules" 

Will that appear as the player said /rules on chat ?

OciXCrom 02-03-2017 13:59

Re: Simple Menu Builder
 
Of course.

Enrory 02-03-2017 19:30

Re: Simple Menu Builder
 
Quote:

Originally Posted by OciXCrom (Post 2492444)
It works fine for me. Did you add [New menu] before [Menu Settings]?

Yes it shows all with names. but nothing do to press 1,2...

PHP Code:

[Default Settings]
;
These are the default settings for each menu created.
;
You can add certain options in [Menu Settings] if you want to change them.
;
Please note that every menu needs to have a different MENU_OPEN settingstherefore there's no default one.

MENU_TITLE = My Simple Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
;MENU_OPEN = say /menu, say_team /menu, amx_mymenu -- This must be set with a different value on every menu!
MENU_FLAG = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_REOPEN = 0
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You have no access to this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND =

[New Menu = CsA Menu]

[Menu Settings]
MENU_OPEN = say menu, say_team menu, amx_mymenu

[Menu Items]
"Trails" "say trail menu"
"Glow" "say glow menu"
"Hats" "say /hats" 
"Change to Story Server" "say /server"
"wheelchairs?" "say wheelchairs?"
"Player finder" "say .lost"
"Fireworks" "say fireworks"
"Music Player" "say /music"
"Chat sounds off" "say /soundsoff"
"Chat sounds on" "say /soundson"

[New Menu = Sub Menu]

[Menu Settings]
MENU_OPEN = submenu1
MENU_TITLE = My Simple Sub Menu
MENU_ITEM_FORMAT = \r< \y%item% \r>

[Menu Items]
"Option 1" "say option1"
"Option 2" "say option2"
"Option 3" "say option3"
"Option 4" "say option4"
"Option X" "do.func(test.amxx, testfunc)" 


yas17sin 02-03-2017 19:50

Re: Simple Menu Builder
 
just delete all from your .ini file and make new by copying this :

PHP Code:

[Default Settings]
;
These are the default settings for each menu created.
;
You can add certain options in [Menu Settings] if you want to change them.
;
Please note that every menu needs to have a different MENU_OPEN settingstherefore there's no default one.

MENU_TITLE = Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_OPEN = say /menu, say_team /menu,
MENU_FLAG = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_REOPEN = 0
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[ Menu ]!n
MENU_NOACCESS = You have no access to this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND =

[New Menu]
Menu Name
[Menu Settings]
;This is the command that will open the menu.
MENU_OPEN = say /menu

[Menu Items]
;"Item name" "command to execute" 

very simple

kristi 02-03-2017 20:49

Re: Simple Menu Builder
 
First menu works fine but the Extra cool Slap Menu doesn't get closed when I press 0. Close
and when i try to open an other menu from other plugin i get this :
Code:

L 02/04/2017 - 02:39:13: Plugin called menu_display when item=MENU_EXIT
L 02/04/2017 - 02:39:13: [AMXX] Displaying debug trace (plugin "shop.amxx")
L 02/04/2017 - 02:39:13: [AMXX] Run time error 10: native error (native "menu_display")
L 02/04/2017 - 02:39:13: [AMXX]    [0] shop.sma::ShopFurien (line 192)
L 02/04/2017 - 02:39:13: [AMXX]    [1] shop.sma::FurienShop (line 153)

then when i disconnect from server
Code:

L 02/04/2017 - 02:39:19: Player 1 is not ingame
L 02/04/2017 - 02:39:19: [AMXX] Displaying debug trace (plugin "crx_simplemenu.amxx")
L 02/04/2017 - 02:39:19: [AMXX] Run time error 10: native error (native "player_menu_info")
L 02/04/2017 - 02:39:19: [AMXX]    [0] crx_simplemenu.sma::handlerMain (line 460)
Firing: (game_playerleave)
Dropped Player from server
Reason:  Client sent 'drop'
No one can buy!!


yas17sin 02-03-2017 21:58

Re: Simple Menu Builder
 
wait for OcixXCrom that's problem from the code in line 460.

Enrory 02-04-2017 06:08

Re: Simple Menu Builder
 
[QUOTE=yas17sin;2492591]just delete all from your .ini file and make new by copying this :

Now it looks so but do the same.
I press /menu and show me the menu with all names.
but commands not work. i press 1 and the menu close. :(

PHP Code:

[Default Settings]
;
These are the default settings for each menu created.
;
You can add certain options in [Menu Settings] if you want to change them.
;
Please note that every menu needs to have a different MENU_OPEN settingstherefore there's no default one.

MENU_TITLE = Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_OPEN = say /menu, say_team /menu,
MENU_FLAG = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_REOPEN = 0
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[ Menu ]!n
MENU_NOACCESS = You have no access to this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND =

[New Menu]
Menu Name
[Menu Settings]
;This is the command that will open the menu.
MENU_OPEN = say /menu

[Menu Items]
"Trails" "say trail menu"
"Glow" "say glow menu"
"Hats" "say /hats" 
"Change to Story Server" "say /server"
"wheelchairs?" "say wheelchairs?"
"Player finder" "say .lost"
"Fireworks" "say fireworks"
"Music Player" "say /music"
"Chat sounds off" "say /soundsoff"
"Chat sounds on" "say /soundson" 


OciXCrom 02-04-2017 08:04

Re: Simple Menu Builder
 
PHP Code:

[New Menu]
Menu Name 

This is incorrect. It should be [New Menu = Menu Name] or just [New Menu].

PHP Code:

MENU_OPEN say /menusay_team /menu

I clearly stated that this setting should NOT be applied for all menus (read the comments on top of the file). There's your problem. Not to mention the comma "," in the end which will bug out the plugin. Remove that entire line.

@kristi - you're right. This will happen when using MENU_REOPEN = 1. I'll fix it.


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

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