New Member
|
09-13-2015
, 21:47
Menus stop working after some time...
|
#1
|
Hi!
Well, my english can be very bad so don't blame at me if u can't understand something... I will try to explain you better xD.
See, I have a CodMod server but some menus doesn't appear after a while & I can't understand why...
Maybe you could help me.
Here's the principal menu.
PHP Code:
#include <amxmodx>
public plugin_init() { register_plugin("CoDMenu", "1.1", "Nightm4re"); register_clcmd("say /codmenu", "ShowMenu", _, ""); register_clcmd("nightvision", "ShowMenu", _, ""); }
public ShowMenu(id) { new menu = menu_create("Nexon Cod Menu", "mh_Nightm4reCodMenu");
menu_additem(menu, "Cambiar clase", "", 0); // case 0 menu_additem(menu, "Ver clases", "", 0); // case 1 menu_additem(menu, "Ver info. de objeto", "", 0); // case 2 menu_additem(menu, "Ver objetos", "", 0); // case 3 menu_additem(menu, "Tirar objeto\r[CUIDADO]", "", 0); // case 4 menu_additem(menu, "Tienda", "", 0); // case 5 menu_additem(menu, "Rachas de bajas", "", 0); // case 6 menu_additem(menu, "Intercambiar", "", 0); // case 7 menu_additem(menu, "Mensajes privados", "", 0); // case 8 menu_additem(menu, "Donar dinero", "", 0); // case 9 menu_additem(menu, "Mostrar/Ocultar puntuacion", "", 0); // case 10 menu_additem(menu, "\yAdmin Menu", "", 0); // case 11
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_setprop(menu, MPROP_BACKNAME, "Atras"); menu_setprop(menu, MPROP_NEXTNAME, "Siguiente"); menu_setprop(menu, MPROP_EXITNAME, "Salir");
menu_display(id, menu, 0);
return PLUGIN_HANDLED; }
public mh_Nightm4reCodMenu(id, menu, item) { if(item == MENU_EXIT) { menu_cancel(id); return PLUGIN_HANDLED; }
new command[6], name[64], access, callback;
menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
switch(item) { case 0: client_cmd(id, "say /clase"); case 1: client_cmd(id, "say /claseinfo"); case 2: client_cmd(id, "say /objeto"); case 3: client_cmd(id, "say /objetos"); case 4: client_cmd(id, "say /tirar"); case 5: client_cmd(id, "say /tienda"); case 6: client_cmd(id, "say /ks"); case 7: client_cmd(id, "say /cambiar"); case 8: client_cmd(id, "say /privados"); case 9: client_cmd(id, "say /donar"); case 10: client_cmd(id, "say /myscore"); case 11: client_cmd(id, "say /adminmenu"); }
menu_destroy(menu);
return PLUGIN_HANDLED; }
That's all okay, but the /adminmenu command doesn't show anything. That's the menu that calls that command.
PHP Code:
#include <amxmodx> #include <amxmisc>
public plugin_init() { register_plugin("AdminMenu", "0.9", "Nightm4re"); register_clcmd("say /adminmenu", "ShowMenu", ADMIN_IMMUNITY, ""); }
public ShowMenu(id, lvl, cid) { // if(!cmd_access(id, lvl, cid, 0)) // client_print(id, print_chat, "[CoD] No tienes acceso a esto!") // return PLUGIN_HANDLED;
new menu = menu_create("\rAdmin Menu", "mh_Nightm4reMenu");
menu_additem(menu, "Amx Mod Menu", "", 0); // case 0 menu_additem(menu, "COD Admin Menu", "", 0); // case 1 menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_setprop(menu, MPROP_BACKNAME, "Atras"); menu_setprop(menu, MPROP_NEXTNAME, "Siguiente"); menu_setprop(menu, MPROP_EXITNAME, "Salir");
menu_display(id, menu, 0);
return PLUGIN_HANDLED; }
public mh_Nightm4reMenu(id, menu, item) { if(item == MENU_EXIT) { menu_cancel(id); return PLUGIN_HANDLED; }
new command[6], name[64], access, callback;
menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
switch(item) { case 0: client_cmd(id, "amxmodmenu"); case 1: client_cmd(id, "say /codadmin"); }
menu_destroy(menu);
return PLUGIN_HANDLED; }
& finally that's the plugin that calls /codadmin.
PHP Code:
#include <amxmodx> #include <codmod> #include <amxmisc>
new opcja, gracz_id[33], wybrany; new ilosc[33], name[33], nazwa_perku[256], nazwa_klasy[256];
public plugin_init() { register_plugin("COD Admin Menu by MieTeK", "1.5", "MieTeK"); register_clcmd("say /codadmin", "AM", ADMIN_LEVEL_H); register_clcmd("ile","pobierz"); } public AM(id) { if(!(get_user_flags(id) & ADMIN_LEVEL_H)) return PLUGIN_HANDLED;
new tytul[64]; format(tytul, 63, "\rCOD Admin Menu \wby MieTeK"); new menu = menu_create(tytul, "AM_handler"); menu_additem(menu, "Agregar \rEXP");//1 menu_additem(menu, "Poner \rLVL");//2 menu_additem(menu, "Dar \rItem");//3 menu_additem(menu, "Mover \rEXP");//4 menu_additem(menu, "Cambiar \rEXP");//5 menu_additem(menu, "Trasladar \rEXP");//6 menu_display(id, menu); return PLUGIN_HANDLED; }
public AM_handler(id, menu, item) { if(!is_user_connected(id)) return PLUGIN_CONTINUE; if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_CONTINUE; } switch(item) { case 0: { Gracz(id); opcja = 1; } case 1: { Gracz(id); opcja = 2; } case 2: { Gracz(id); opcja = 3; } case 3: { Gracz(id); opcja = 4; } case 4: { Gracz(id); opcja = 5; } case 5: { Gracz(id); opcja = 6; } } return PLUGIN_CONTINUE; }
public Gracz(id) { new menu = menu_create("Seleccione jugador:", "Gracz_handler"); for(new i=0, n=0; i<=32; i++) { if(!is_user_connected(i)) continue; gracz_id[n++] = i; new nazwa_gracza[64]; get_user_name(i, nazwa_gracza, 63) menu_additem(menu, nazwa_gracza, "0", 0); } menu_display(id, menu); }
public Gracz_handler(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_CONTINUE; } wybrany = gracz_id[item]; get_user_name(wybrany, name, 32); if(opcja == 3) wybierz_perk(id); else if(opcja == 4 || opcja == 5 || opcja == 6) wybierz_klase(id); else console_cmd(id, "messagemode cantidad"); return PLUGIN_HANDLED; }
public pobierz(id) { new text[192] read_argv(1,text,191) format(ilosc, charsmax(ilosc), "%s", text); dawaj(id) } public dawaj(id) { if(opcja == 1) { cod_set_user_xp(wybrany, cod_get_user_xp(wybrany)+str_to_num(ilosc)); client_print(id, print_chat, "Establece %s %i EXP", name, str_to_num(ilosc)); } if(opcja == 2) { new potrzeba; potrzeba = cod_get_level_xp(str_to_num(ilosc)-1); cod_set_user_xp(wybrany, potrzeba); client_print(id, print_chat, "Establece %s %i LVL", name, str_to_num(ilosc)); } }
public wybierz_klase(id) { new tytul[64]; format(tytul, sizeof(tytul), "\rPara la clase :"); new menu = menu_create(tytul, "wybierz_klase_handler"); for(new i=1; i<=cod_get_classes_num(); i++) { cod_get_class_name(i, nazwa_klasy, 255) menu_additem(menu, nazwa_klasy) } menu_display(id, menu); }
public wybierz_klase_handler(id, menu, item) { if(item++ == MENU_EXIT) { menu_destroy(menu) return PLUGIN_CONTINUE; } new klasa[2][65]; if(opcja == 4) { new exp = cod_get_user_xp(wybrany); cod_get_class_name(cod_get_user_class(wybrany), klasa[0], 64); cod_set_user_xp(wybrany, 0); cod_set_user_class(wybrany, item, 1); cod_get_class_name(cod_get_user_class(wybrany), klasa[1], 64); cod_set_user_xp(wybrany, exp); client_print(id, print_chat, "Movio %s EXP de la clase %s a la clase %s", name, klasa[0], klasa[1]); } if(opcja == 5) { new exp = cod_get_user_xp(wybrany); new oldclass = cod_get_user_class(wybrany) cod_get_class_name(cod_get_user_class(wybrany), klasa[0], 64); cod_set_user_class(wybrany, item, 1); new exp2 = cod_get_user_xp(wybrany); cod_set_user_xp(wybrany, exp); cod_get_class_name(cod_get_user_class(wybrany), klasa[1], 64); cod_set_user_class(wybrany, oldclass, 1); cod_set_user_xp(wybrany, exp2); cod_set_user_class(wybrany, item, 1); client_print(id, print_chat, "Cambiaste EXP del jugador %s de la clase %s a la clase %s", name, klasa[0], klasa[1]); } if(opcja == 6) { new exp = cod_get_user_xp(wybrany); cod_set_user_xp(wybrany, 0); cod_get_class_name(cod_get_user_class(wybrany), klasa[0], 64); cod_set_user_class(wybrany, item, 1); cod_get_class_name(cod_get_user_class(wybrany), klasa[1], 64); cod_set_user_xp(wybrany, cod_get_user_xp(wybrany)+exp); client_print(id, print_chat, "Trasladaste %s de la clase %s a la clase %s", name, klasa[0], klasa[1]); } return PLUGIN_CONTINUE; }
public wybierz_perk(id) { new tytul[64]; format(tytul, 63, "\rQue objeto :"); new menu = menu_create(tytul, "wybierz_perk_handler"); for(new i=1; i<=cod_get_perks_num(); i++) { cod_get_perk_name(i, nazwa_perku, 255) menu_additem(menu, nazwa_perku); } menu_display(id, menu); }
public wybierz_perk_handler(id, menu, item) { if(item++ == MENU_EXIT) { menu_destroy(menu); return PLUGIN_CONTINUE; } cod_set_user_perk(wybrany, item, -1, 0); cod_get_perk_name(item++, nazwa_perku, 255); client_print(id, print_chat, "Diste al jugador %s el objeto %s", name, nazwa_perku); return PLUGIN_HANDLED; }
Ok, now, my problem is that the command /adminmenu doesn't show up anything.
The last plugin only show something in the 3, 4, 5 & 6 case, which also serve me a lot...
It's large, it's hard(for me) but I would be very glad if someone could help me... I gave a lot of my time to this but now begins to fail...
LOTS OF THANKS
EDIT.: And I clarify that the first time I tried it was working well. Yes, I tried ; in the others plugins to search an incompatibility...
Last edited by pokedavid012; 09-13-2015 at 21:54.
Reason: I left something.
|
|