AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [menu not working] (https://forums.alliedmods.net/showthread.php?t=47983)

Da_sk8rboy 12-01-2006 16:02

[menu not working]
 
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "Model_Me_Mod123" #define VERSION "1.00a" #define AUTHOR "Da_sk8rboy" new g_Switch; new menu[192]; new keys = MENU_KEY_0 | MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 public plugin_init() {                 register_plugin(PLUGIN, VERSION, AUTHOR);       register_concmd("amx_modelme", "show_menu");     register_menu("menu_show",1023,"menu_choose");     g_Switch = register_cvar("cm_switch","1");     register_cvar("cm_modelme1", "5000")     register_cvar("cm_modelme2", "8000")     register_cvar("cm_modelme3", "16000") } public menu_show(id) {               if(get_pcvar_num(g_Switch)==0)     {         return PLUGIN_HANDLED;     }else{         format(menu,191,"[AMX] Models^n1. Model1^n.2 Model2^n3. Model3^n^n.Exit");         show_menu(id,keys,menu,-1,"show_menu");         return PLUGIN_CONTINUE;     }     return PLUGIN_HANDLED; } public choose_menu(id,key) {     switch(key)     {                 case 0 : cs_set_user_model(id, "modelme2")             case 1 : cs_set_user_model(id, "modelme3")             case 2 : cs_set_user_model(id, "modelme1")             }       return PLUGIN_HANDLED; } public plugin_precache() {               precache_model("models/player/model1/model1.mdl");     precache_model("models/player/model2/model2.mdl");     precache_model("models/player/model3/model3.mdl"); }

Menu will not come up when i use the cmd, anyone know whats wrong? it compiles ok, no errors! :|

P34nut 12-01-2006 16:06

Re: [menu not working]
 
Code:
 register_menu("menu_show",1023,"menu_choose");
should be
Code:
 register_menu(register_menuid("show_menu"), 1023, "choose_menu)

and your show_menu function does not exist: register_concmd("amx_modelme", "show_menu");

Da_sk8rboy 12-01-2006 16:28

Re: [menu not working]
 
So i would change:
show_menu(id,keys,menu,-1,"show_menu");
to

Code:

show_menu(id,keys,menu,-1,"menu_show")
[FONT=normal,'Times New Roman']
[/FONT]

P34nut 12-01-2006 16:31

Re: [menu not working]
 
what??


btw do you use amxx studio? there is a handy menu generator for people like you..

The Specialist 12-01-2006 16:33

Re: [menu not working]
 
actaully peanut using register_menu is valid. if you look at the source file for some of the ammxmodx base plugins youll see it there. I also use it.

Da_sk8rboy 12-01-2006 16:34

Re: [menu not working]
 
yes i use amx studios. thats all i use, specialist helped me with the menu

LittleDude 12-01-2006 20:06

Re: [menu not working]
 
you're not even calling the correct menu using your code


All times are GMT -4. The time now is 06:51.

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