AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Simple menu.. (https://forums.alliedmods.net/showthread.php?t=28101)

tbonus 05-07-2006 08:40

Simple menu..
 
I am trying to make this menu so I can access common cmds and command menus. #1, 4, 5,6, and 7 don't work.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "tb Menu" #define VERSION "0.1" #define AUTHOR "tbonus" new g_Menu public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)           register_clcmd("say /tbmenu", "Menu_Command", ADMIN_CFG)     register_clcmd("amx_tbsmenu", "Menu_Command", ADMIN_CFG)           g_Menu = menu_create("tb's Menu", "Menu_Handle")     menu_additem(g_Menu, "Go to tb's amxmodmenu", "1")     menu_additem(g_Menu, "Hook on", "2")     menu_additem(g_Menu, "Hook off", "3")     menu_additem(g_Menu, "CAL menu", "4")     menu_additem(g_Menu, "csdm_menu", "5")     menu_additem(g_Menu, "Unlimited Nades", "6")     menu_additem(g_Menu, "Unlimited Nades off", "7") } public Menu_Command(id, level, cid) {     if (!cmd_access(id, level, cid, 1))         return PLUGIN_HANDLED               menu_display(id, g_Menu, 0)           return PLUGIN_HANDLED } public Menu_Handle(id, Menu, Item) {     new szCommand[3],  Accesss, Callback           menu_item_getinfo(Menu, Item, Accesss, szCommand, 2, _, _, Callback)           switch(szCommand[0])     {         case '-':         {             return PLUGIN_HANDLED         }                   case '1':         {             server_cmd("amx_tbmenu")                     }                   case '2':         {             server_cmd("df_hook_on 1")         }                   case '3':         {             server_cmd("df_hook_on 0")         }                   case '4':         {             server_cmd("amx_calmenu")         }                   case '5':         {             server_cmd("csdm_menu")         }                   case '6':         {             server_cmd("amx_nade *all")         }                   case '7':         {             server_cmd("amx_unnade *all")         }     }           return PLUGIN_HANDLED }

FatalisDK 05-07-2006 08:44

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "tb Menu" #define VERSION "0.1" #define AUTHOR "tbonus" new g_Menu public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)           register_clcmd("say /tbmenu", "Menu_Command", ADMIN_CFG)     register_clcmd("amx_tbsmenu", "Menu_Command", ADMIN_CFG)           g_Menu = menu_create("tb's Menu", "Menu_Handle")     menu_additem(g_Menu, "Go to tb's amxmodmenu", "1")     menu_additem(g_Menu, "Hook on", "2")     menu_additem(g_Menu, "Hook off", "3")     menu_additem(g_Menu, "CAL menu", "4")     menu_additem(g_Menu, "csdm_menu", "5")     menu_additem(g_Menu, "Unlimited Nades", "6")     menu_additem(g_Menu, "Unlimited Nades off", "7") } public Menu_Command(id, level, cid) {     if (!cmd_access(id, level, cid, 1))         return PLUGIN_HANDLED               menu_display(id, g_Menu, 0)           return PLUGIN_HANDLED } public Menu_Handle(id, Menu, Item) {     new szCommand[3],  Accesss, Callback           menu_item_getinfo(Menu, Item, Accesss, szCommand, 2, _, _, Callback)           switch(szCommand[0])     {         case '-':         {             return PLUGIN_HANDLED         }                   case '1':         {             client_cmd(id, "amx_tbmenu")         }                   case '2':         {              set_cvar_num("df_hook_on", 1)         }                   case '3':         {             set_cvar_num("df_hook_on", 0)         }                   case '4':         {             client_cmd(id, "cal_menu")         }                   case '5':         {             client_cmd(id, "csdm_menu")         }                   case '6':         {             server_cmd("amx_nade *")         }                   case '7':         {             server_cmd("amx_unnade *")         }     }           return PLUGIN_HANDLED }

tbonus 05-07-2006 14:27

Code:
#include <amxmodx>   #include <amxmisc>   #include <cstrike>   #define PLUGIN "tb Menu"   #define VERSION "0.1"   #define AUTHOR "tbonus"   new g_Menu   public plugin_init()   {       register_plugin(PLUGIN, VERSION, AUTHOR)             register_clcmd("say /tbmenu", "Menu_Command", ADMIN_CFG)       register_clcmd("amx_tbsmenu", "Menu_Command", ADMIN_CFG)             g_Menu = menu_create("tb's Menu", "Menu_Handle")       menu_additem(g_Menu, "Go to tb's amxmodmenu", "1")       menu_additem(g_Menu, "Hook on", "2")       menu_additem(g_Menu, "Hook off", "3")       menu_additem(g_Menu, "CAL menu", "4")       menu_additem(g_Menu, "csdm_menu", "5")       menu_additem(g_Menu, "Unlimited Nades", "6")       menu_additem(g_Menu, "Unlimited Nades off", "7")   }   public Menu_Command(id, level, cid)   {       if (!cmd_access(id, level, cid, 1))           return PLUGIN_HANDLED                 menu_display(id, g_Menu, 0)             return PLUGIN_HANDLED   }   public Menu_Handle(id, Menu, Item)   {       new szCommand[3],  Accesss, Callback             menu_item_getinfo(Menu, Item, Accesss, szCommand, 2, _, _, Callback)             switch(szCommand[0])       {           case '-':           {               return PLUGIN_HANDLED           }                     case '1':           {               client_cmd(id, "amx_tbmenu")         }                     case '2':           {                set_cvar_num("df_hook_on", 1)         }                     case '3':           {             set_cvar_num("df_hook_on", 0)         }                     case '4':           {               client_cmd(id, "amx_calmenu")         }                     case '5':           {               client_cmd(id, "csdm_menu")         }                     case '6':           {               client_cmd(id, "amx_nade *")         }                     case '7':           {               client_cmd(id, "amx_unnade *")         }       }             return PLUGIN_HANDLED   }
thanks fatalisdk, you put the wrong thing for cal menu and amx_nade is a client I think cause it worked after I changed it

v3x 05-07-2006 15:38

At least show him what he did what and what you did to fix it.

tbonus 05-07-2006 19:08

me show fatalis or fatalis show me?

FatalisDK 05-07-2006 19:09

You show me, and I already know what you meant so no need.

Peli 05-07-2006 19:26

v3x meant for you to atleast add comments in the parts where you were supposed to tell him what he did wrong, and how you fixed it so that he can understand.

tbonus 05-07-2006 20:18

I understand..we talked on xfire.

raa 05-12-2006 08:23

Quote:

Originally Posted by tbonus
I understand..we talked on xfire.

and for the rest of the community?



People forget what forums are all about these days.. jeezzz


All times are GMT -4. The time now is 05:08.

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