like this?
PHP Code:
#include <amxmodx>
#define PLUGIN "Test"
#define AUTHOR "Epic"
#define VERSION "1.0"
new onoff = 0
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /menu", "Menu")
}
public Menu(id)
{
new menu = menu_create("Choose an Option:", "Menu_Handler")
if(!onoff)
{
menu_additem(menu, "Godmode \d[ON/\wOFF]", "1", 0);
}
else if(onoff)
{
menu_additem(menu, "Godmode [ON\d/OFF]", "1", 0);
}
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public Menu_Handler(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:
{
if(!onoff)
{
onoff = 1
}
else if(onoff)
{
onoff = 0
}
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}