Raised This Month: $ Target: $400
 0% 

[Question/Req]Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Meep69
Member
Join Date: Jan 2014
Old 02-19-2015 , 20:13   [Question/Req]Menu
Reply With Quote #1

Is it possible to make a menu out of other plugins commands? Lets say I have a plugin where you can type /help and /rules. Is it possible to have another menu plugin that show ex: 1. help 2. rules and if I click them it will respond the same way as if I was typing either /help or /rules?

If it's possible could anyone make one for me?

/Menu to get the menu.

Menu:
1. Rules (/rules)
2. Daysmenu (/daysmenu)
3. Shop (/shop)
4. Countdown (/countdown)

Thanks.

Last edited by Meep69; 02-19-2015 at 20:14.
Meep69 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-19-2015 , 21:54   Re: [Question/Req]Menu
Reply With Quote #2

Code:
#include <amxmodx>

public plugin_init() 
{
    register_plugin("Menu", "0.1", "")
    
    register_clcmd("say /menu", "clcmd_menu")
    register_clcmd("say_team /menu", "clcmd_menu")
}

public clcmd_menu(id)
{
    new szMenu = menu_create("\yCustom Menu", "menu_handler")
    
    menu_additem(szMenu, "\wRules!", "1", 0 );
    menu_additem(szMenu, "\wDay Menu", "2", 0 );
    menu_additem(szMenu, "\wShop!", "3", 0 );
    menu_additem(szMenu, "\wCountdown!", "3", 0 );
    
    menu_display( id, szMenu, 0 )
}

public menu_handler(id, szMenu, item)
{
    switch(item)
    {
        case 0: client_cmd(id, "say /rules")
        case 1: client_cmd(id, "say /daysmenu")
        case 2: client_cmd(id, "say /shop")
        case 3: client_cmd(id, "say /countdown")
    }
    
    menu_destroy(szMenu)
}

Last edited by zmd94; 02-19-2015 at 21:55.
zmd94 is offline
Meep69
Member
Join Date: Jan 2014
Old 02-20-2015 , 10:40   Re: [Question/Req]Menu
Reply With Quote #3

works good, thank you!
Meep69 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-20-2015 , 10:52   Re: [Question/Req]Menu
Reply With Quote #4

I'm glad I can help. ;)
zmd94 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 20:01.


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