Raised This Month: $ Target: $400
 0% 

[MENU] Take argument


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Ex3cuTioN
Member
Join Date: May 2010
Old 07-07-2010 , 02:25   [MENU] Take argument
Reply With Quote #1

This is an example. What i want to do is to make a menu line to be like a console command.

When i press 1 i must write the tag of T's and when i press 2 i must write the tag of CT's.

I cand make it with

hns_tag <T's tag> <CT's tag>

This workd, but it's in the console and i want to know if it can be possibile to make it from the menu...

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Plugin Nou"
#define VERSION "0.1"
#define AUTHOR "Ex3cuTioN"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /hns","cmdHNS");
    
register_clcmd("say /war","cmdHNS");
}

public 
cmdHNS(id)
{
    if(!
is_user_admin(id))
        return 
PLUGIN_HANDLED;

    else
    {
        new 
menu menu_create("\yHNS Menu:""settings");
   
        
menu_additem(menu"\wTerrorist TAG""1"0);
        
menu_additem(menu"\wCoutner TAG""2"0);
   
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
        
menu_display(idmenu0);
    }
    
    return 
PLUGIN_HANDLED;
}

public 
settings(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
   
    new 
data[6], iName[64];
    new 
accesscallback;
   
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            
//code
        
}
        case 
2:
        {
            
//code2
        
}
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

Ex3cuTioN is offline
 



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 07:11.


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