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(PLUGIN, VERSION, AUTHOR)
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(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
return PLUGIN_HANDLED;
}
public settings(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
//code
}
case 2:
{
//code2
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}