AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any?] hConfigMenus <1.1|11/2/18> (https://forums.alliedmods.net/showthread.php?t=311738)

alexr153 10-31-2018 19:34

[Any?] hConfigMenus <1.1|11/2/18>
 
2 Attachment(s)
Description
This plugin allows you to make a menu within a config file. The default prefix for this is |, you will have to recompile it if you wanted to change this.
You can do basic functions with this plugin: reopen the menu that is open, a client command, or no command. I was bored so I just made this for fun.

ConVars
sm_hMenus_enabled "1" //Enables or disables the plugin
sm_hMenus_joinmenu "1" //(1) The join menu will only show once (0) The join menu will show on every map change

Template
File location: sourcemod/configs/hMenus.cfg
PHP Code:

"Menus"
{
    
"|template"
    
{
        
"flag" ""
        "title" "This is a regular template that anyone can use"
        "item0" "You can make it do certain commands.||reopen menu"
        "item1" "For Example, if you have store it will open up the store menu||sm_store"
        "item2" "There are a maximum of 16 items||reopen menu"
        "item3" "If you need any help, make sure to post your question on the forums||reopen menu"
        "item4" "If any bugs do occur with this please post ASAP on the forums||reopen menu"
        "item5" "I do not have anything planned with this plugin currently||reopen menu"
        "item6" "If you have any suggestions again post it on the forums xD||reopen menu"
        "item7" "-------------------------------------------------||reopen menu"
        "item8" "Now to make a menu is fairly simple||reopen menu"
        "item9" "First you would make the command to look for, which is |template in this case||reopen menu"
        "item10" "Then you can set a flag for that menu by doing *flag* *a* or whatever||reopen menu"
        "item11" "Next, you would want to set a title for it. *title* *your title*"
        "item12" "Lastly, set your items of the menu. Make sure you add 1 to the end||reopen menu"
        "item13" "Current commands you can use are: reopen menu, none, or an actual command||reopen menu"
        "item14" "* these are supposed to be quotes||reopen menu"
        "item15" "If you would like to close this menu do this for the command||none"
    
}
    
"|template2"
    
{
        
"flag" "z"
        "title" "This is a flagged template that certain people can use"
        "item0" "You can make it do certain commands.||reopen menu"
        "item1" "For Example, if you have store it will open up the store menu||sm_store"
        "item2" "There are a maximum of 16 items||reopen menu"
        "item3" "If you need any help, make sure to post your question on the forums||reopen menu"
        "item4" "If any bugs do occur with this please post ASAP on the forums||reopen menu"
        "item5" "I do not have anything planned with this plugin currently||reopen menu"
        "item6" "If you have any suggestions again post it on the forums xD||reopen menu"
        "item7" "-------------------------------------------------||reopen menu"
        "item8" "Now to make a menu is fairly simple||reopen menu"
        "item9" "First you would make the command to look for, which is |template in this case||reopen menu"
        "item10" "Then you can set a flag for that menu by doing *flag* *a* or whatever||reopen menu"
        "item11" "Next, you would want to set a title for it. *title* *your title*"
        "item12" "Lastly, set your items of the menu. Make sure you add 1 to the end||reopen menu"
        "item13" "Current commands you can use are: reopen menu, none, or an actual command||reopen menu"
        "item14" "* these are supposed to be quotes||reopen menu"
        "item15" "If you would like to close this menu do this for the command||none"
    
}
    
"|template3"
    
{
        
"flag" "z"
        "title" "This is a flagged template that certain people can use"
        "item0" "Only want a certain amount do end on an item||none"
        "item1" "Open SubMenu1||submenu::[submenu1]"
        "item2" "Open SubMenu2||submenu::[submenu2]"
        "item3" "SubMenus can be any name in any format. It does not have to follow [submenu...]"
        "item4" "Open Target Menu. (Command sm_profile <target>)||targetmenu::sm_profile"
        "item5" "end"
    
}
    
"join"
    
{
        
"flag" ""
        "title" "This is a template for creating a join menu"
        "item0" "This is great for welcome messages||reopen menu"
        "item1" "end"
    
}
    
"[submenu1]"
    
{
        
"flag" ""
        "title" "This is a template for creating a sub menu"
        "item0" "This is just for testing purposes||reopen menu"
        "item1" "This is just for testing purposes||none"
        "item2" "end"
    
}
    
"[submenu2]"
    
{
        
"flag" ""
        "title" "This is a template for creating a sub menu"
        "item0" "Do sm_rank||sm_rank"
        "item1" "This is just for testing purposes||none"
        "item2" "end"
    
}


Change Log
Code:

1.1 - Added sub menus, target menus, and a join menu. One ConVar was added sm_hMenus_joinmenu.
1.0 - Released plugin


404UserNotFound 11-02-2018 01:51

Re: [Any?] hConfigMenus
 
Building a menu from within a config file. What an idea. This looks pretty cool.

Edit: And I'm going to use it to help me teach myself how to code keyvalues stuff.

Cruze 11-02-2018 02:29

Re: [Any?] hConfigMenus
 
Can you make it support subitem?
Example:-
Code:

"|template"
{
    "item0"
    {
          "subitem0"    "xyz"
    }
}


alexr153 11-02-2018 10:06

Re: [Any?] hConfigMenus
 
Quote:

Originally Posted by 404UNF (Post 2622261)
Building a menu from within a config file. What an idea. This looks pretty cool.

Edit: And I'm going to use it to help me teach myself how to code keyvalues stuff.

Thank you, I was just insanely bored and I thought of this LOL. I'm glad I could help you with something.

Quote:

Can you make it support subitem?
Example:-
Code:

"|template"
{
    "item0"
    {
          "subitem0"    "xyz"
    }
}


I'll be sure to add this when I get home today.

vERKE 11-02-2018 11:49

Re: [Any?] hConfigMenus
 
Looks sweet!

tzzion 11-02-2018 15:37

Re: [Any?] hConfigMenus
 
Good job man!

Could you make a cvar so that the menu opens automatically when the player enters in the server?

alexr153 11-02-2018 22:00

Re: [Any?] hConfigMenus
 
Quote:

Originally Posted by tzzion (Post 2622332)
Good job man!

Could you make a cvar so that the menu opens automatically when the player enters in the server?

Will do :)

LiMaaa 11-18-2018 14:08

Re: [Any?] hConfigMenus <1.1|11/2/18>
 
Great menu system, although I am having issues getting "join" feature to show for anyone on my servers. Could it be broken?

Also some feature requests:
- Ability to use title text throughout menu for announcements: title0, title1, title2, etc
- Ability to use two prefixes for each menu via cfg, so people can silent trigger and public trigger: "!template" "/template"
- Ability to embed say calls to menu so can print to chat and trigger shortcut commands that don't use sm_plugin: View Event||!event or View Event||/event

axelnieves2012 01-25-2019 23:56

Re: [Any?] hConfigMenus <1.1|11/2/18>
 
great job. I need a plugin like this but with custom cfg votation.

About this plugin, I could notice, commands are server executed... Is any way to execute commands on same client who called the menu?


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

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