Raised This Month: $ Target: $400
 0% 

Solved how to use cmd in menu ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 02-08-2017 , 18:03   how to use cmd in menu ?
Reply With Quote #1

Hi guys.

i create a menu and i want to exec a commande in the item selected.

i have some guns can get by commande like "get_gs" and i want to exec this cmd like i say in the menu each item have cmd.

PS : be easy on me it's my first menu.

code :
PHP Code:
#include <amxmodx>

#define PLUGIN "First Menu Ever"
#define VERSION "1.0"
#define AUTHOR "yas17sin"

new menu;

public 
plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR)
    
register_clcmd"say /pmenu""pro_menu" )
}
public 
pro_menuid )
{
    if(!
is_user_alive(id))
        return;
    
    
menu menu_create"Pro VIP Weapon Menu""menu_handler" );
    
    
menu_additemmenu"Gauss Sniper """ADMIN_KICK )
    
menu_additemmenu"Gilboa-Viper """)
    
menu_additemmenu"Auto-Sniper : VSK""")
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);
}
    
public 
menu_handleridmenuitem )
{
    switch( 
item )
    {
        case 
0:
        {
            
client_printidprint_chat"You Have Select Pro Gauss Sniper" );
        }
        case 
1:
        {
            
client_printidprint_chat"You Have Select Pro Gilboa Viper" );
        }
        case 
2:
        {
            
client_printidprint_chat"You Have Auto Sniper : VSK" );
        }
        case 
MENU_EXIT:
        {
            
client_printidprint_chat"Good Luck And Be PRO");
        }
    }
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;

Thanks for help guys.

Last edited by yas17sin; 02-10-2017 at 11:16.
yas17sin is offline
Send a message via ICQ to yas17sin
 



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:41.


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