Raised This Month: $51 Target: $400
 12% 

Escape Menus in Sourcemod?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-05-2009 , 13:54   Escape Menus in Sourcemod?
Reply With Quote #1

Basically I am just trying to figure out if you can do escape menus for TF2 with sourcemod, and if so how. Theres not much on the wiki about them, and I would prefer not to have to write a MMS plugin solely for that if I can avoid it.
__________________
CrimsonGT is offline
recon0
Veteran Member
Join Date: Sep 2007
Location: US
Old 01-05-2009 , 15:02   Re: Escape Menus in Sourcemod?
Reply With Quote #2

Quote:
Originally Posted by CrimsonGT View Post
Basically I am just trying to figure out if you can do escape menus for TF2 with sourcemod, and if so how. Theres not much on the wiki about them, and I would prefer not to have to write a MMS plugin solely for that if I can avoid it.
Why would you want to???

It's simple though.

Quote:
Originally Posted by API
CreateMenuEx

Syntax: native Handle:CreateMenuEx(Handle:hStyle=INVALID_HAN DLE, MenuHandler:handler, MenuAction:actions=MENU_ACTIONS_DEFAULT);

Usage: handler Function which will receive menu actions.
actions Optionally set which actions to receive. Select, Cancel, and End will always be received regardless of whether they are set or not. They are also the only default actions.Notes: Creates a Menu from a MenuStyle. The Handle must be closed with CloseHandle().

Return: A new menu Handle.

Version Added:1.0.0.1946
On error / Errors: Invalid Handle other than INVALID_HANDLE.
Quote:
Originally Posted by API
GetMenuStyleHandle

Syntax: native Handle:GetMenuStyleHandle(MenuStyle:style);

Usage: style Menu Style.Notes: Returns a style's global Handle.

Return: A Handle, or INVALID_HANDLE if not found or unusable.

Version Added:1.0.0.1946
Quote:
Originally Posted by API
Code:
enum MenuStyle
{
    MenuStyle_Default = 0,        /**< The "default" menu style for the mod */
    MenuStyle_Valve = 1,        /**< The Valve provided menu style (Used on HL2DM) */
    MenuStyle_Radio = 2,        /**< The simpler menu style commonly used on CS:S */
};
__________________
recon0 is offline
Sollie
Junior Member
Join Date: Sep 2008
Old 01-05-2009 , 18:27   Re: Escape Menus in Sourcemod?
Reply With Quote #3

Can you make example please? I want know too and I search forums and nothing found except two post that not really say much. Thank you !!
Sollie is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 01-06-2009 , 07:04   Re: Escape Menus in Sourcemod?
Reply With Quote #4

Code:
public func_createMenu(client) {     new Handle:hMenu = CreateMenuEx(MenuStyle_Valve,fn_MenuHandler);         SetMenuTitle(hMenu,"My Awesome menu");         AddMenuItem(hMenu,"Option 1","Option #1");     AddMenuItem(hMenu,"Option 2","Option #2");     AddMenuItem(hMenu,"Option 3","Option #3");         DisplayMenu(hMenu,client,MENU_TIME_FOREVER); } public fn_MenuHandler(Handle:menu, MenuAction:action, param1, param2) {     // stuff }
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
fcIndigo
Junior Member
Join Date: Jan 2009
Old 01-31-2009 , 08:53   Re: Escape Menus in Sourcemod?
Reply With Quote #5

Hello!

Since I'm doing pretty much the same as the initial poster, namely working on menus, I now wonder if there is any way to allow players to select menu items either via a console command, keybind or similar.

Problem is, most situations ingame don't really give you enough time to press esc, locate the menu (for instance map votes and such), browse through several pages of choices (again map selection), finally locate and select your choice. By the time you did all this as a player, you most likely died several times xD

Please notice I'd prefer a non-plugin approach to selecting (esc-)menu choices, like a console command or keybind, since this technique can be used on many servers then, regardless if there is the appropriate plugin running or not.

Any hint into the right direction is highly appreciated!

Thanks


P.S: Sorry for bumping a somewhat older thread, I just thought this fits in here just as well, rather than creating a topic on it's own.
fcIndigo is offline
BAILOPAN
Join Date: Jan 2004
Old 02-01-2009 , 03:24   Re: Escape Menus in Sourcemod?
Reply With Quote #6

I don't understand your question. What is a "non-plugin approach?" Why would the menu be there to even select if the plugin behind it didn't exist?

Your question also seems totally different than the original poster. The short answer is: SourceMod does not abstract menu item selection in any sort of console manner.

You could request this but there'd have to be a good use case.
__________________
egg
BAILOPAN 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 12:53.


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