Raised This Month: $ Target: $400
 0% 

Menus stop working after some time...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pokedavid012
New Member
Join Date: Oct 2011
Old 09-13-2015 , 21:47   Menus stop working after some time...
Reply With Quote #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(menuMPROP_EXITMEXIT_ALL);
    
menu_setprop(menuMPROP_BACKNAME"Atras");
    
menu_setprop(menuMPROP_NEXTNAME"Siguiente");
    
menu_setprop(menuMPROP_EXITNAME"Salir");

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}

public 
mh_Nightm4reCodMenu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

    switch(
item)
    {
        case 
0client_cmd(id"say /clase");
        case 
1client_cmd(id"say /claseinfo");
        case 
2client_cmd(id"say /objeto");
        case 
3client_cmd(id"say /objetos");
        case 
4client_cmd(id"say /tirar");
        case 
5client_cmd(id"say /tienda");
        case 
6client_cmd(id"say /ks");
        case 
7client_cmd(id"say /cambiar");
        case 
8client_cmd(id"say /privados");
        case 
9client_cmd(id"say /donar");
        case 
10client_cmd(id"say /myscore");
        case 
11client_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(idlvlcid)
{
//    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(menuMPROP_EXITMEXIT_ALL);
    
menu_setprop(menuMPROP_BACKNAME"Atras");
    
menu_setprop(menuMPROP_NEXTNAME"Siguiente");
    
menu_setprop(menuMPROP_EXITNAME"Salir");

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}

public 
mh_Nightm4reMenu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

    switch(
item)
    {
        case 
0client_cmd(id"amxmodmenu");
        case 
1client_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 opcjagracz_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(tytul63"\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(idmenu);
    
    return 
PLUGIN_HANDLED;
}

public 
AM_handler(idmenuitem)
{
    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=0n=0i<=32i++)
    {
        if(!
is_user_connected(i))
            continue;
        
gracz_id[n++] = i;
        new 
nazwa_gracza[64];
        
get_user_name(inazwa_gracza63)
        
menu_additem(menunazwa_gracza"0"0);
    }
    
menu_display(idmenu);
}

public 
Gracz_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_CONTINUE;
    }
    
    
wybrany gracz_id[item];
    
get_user_name(wybranyname32);
    
    if(
opcja == 3)
        
wybierz_perk(id);
    else if(
opcja == || opcja == || 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(ilosccharsmax(ilosc), "%s"text);
    
dawaj(id)
}
    
public 
dawaj(id)
{
    if(
opcja == 1)
    {
        
cod_set_user_xp(wybranycod_get_user_xp(wybrany)+str_to_num(ilosc));
        
client_print(idprint_chat"Establece %s %i EXP"namestr_to_num(ilosc));
    }
    if(
opcja == 2)
    {
        new 
potrzeba;
        
potrzeba cod_get_level_xp(str_to_num(ilosc)-1);
        
cod_set_user_xp(wybranypotrzeba);
        
        
client_print(idprint_chat"Establece %s %i LVL"namestr_to_num(ilosc));
    }
}

public 
wybierz_klase(id)
{
    new 
tytul[64];
    
format(tytulsizeof(tytul), "\rPara la clase :");
    new 
menu menu_create(tytul"wybierz_klase_handler");
    for(new 
i=1i<=cod_get_classes_num(); i++)
    {
        
cod_get_class_name(inazwa_klasy255)
        
menu_additem(menunazwa_klasy)
    }
    
    
menu_display(idmenu);
}

public 
wybierz_klase_handler(idmenuitem)
{
    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(wybrany0);
        
cod_set_user_class(wybranyitem1);
        
cod_get_class_name(cod_get_user_class(wybrany), klasa[1], 64);
        
cod_set_user_xp(wybranyexp);
        
client_print(idprint_chat"Movio %s EXP de la clase %s a la clase %s"nameklasa[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(wybranyitem1);
        new 
exp2 cod_get_user_xp(wybrany);
        
cod_set_user_xp(wybranyexp);
        
cod_get_class_name(cod_get_user_class(wybrany), klasa[1], 64);
        
cod_set_user_class(wybranyoldclass1);
        
cod_set_user_xp(wybranyexp2);
        
cod_set_user_class(wybranyitem1);
        
client_print(idprint_chat"Cambiaste EXP del jugador %s de la clase %s a la clase %s"nameklasa[0], klasa[1]);
    }
    if(
opcja == 6)
    {
        new 
exp cod_get_user_xp(wybrany);
        
cod_set_user_xp(wybrany0);
        
cod_get_class_name(cod_get_user_class(wybrany), klasa[0], 64);
        
cod_set_user_class(wybranyitem1);
        
cod_get_class_name(cod_get_user_class(wybrany), klasa[1], 64);
        
cod_set_user_xp(wybranycod_get_user_xp(wybrany)+exp);
        
client_print(idprint_chat"Trasladaste %s de la clase %s a la clase %s"nameklasa[0], klasa[1]);
    }
    return 
PLUGIN_CONTINUE;
}

public 
wybierz_perk(id)
{
    new 
tytul[64];
    
format(tytul63"\rQue objeto :");
    new 
menu menu_create(tytul"wybierz_perk_handler");
    for(new 
i=1i<=cod_get_perks_num(); i++)
    {
        
cod_get_perk_name(inazwa_perku255)
        
menu_additem(menunazwa_perku);
    }
    
    
menu_display(idmenu);
}

public 
wybierz_perk_handler(idmenuitem)
{
    if(
item++ == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_CONTINUE;
    }
    
    
cod_set_user_perk(wybranyitem, -10);
    
cod_get_perk_name(item++, nazwa_perku255);
    
    
client_print(idprint_chat"Diste al jugador %s el objeto %s"namenazwa_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.
pokedavid012 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:01.


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