AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   make a menu (ESF) (https://forums.alliedmods.net/showthread.php?t=51980)

turbex 02-28-2007 00:25

make a menu (ESF)
 
i try this code:
PHP Code:

#include <amxmodx>
#include <engine>
#include <engine_const>
#include <fun>
#include <fakemeta>
#include <fakemeta_const>

public plugin_init()
{
    
register_plugin("turbexEvolution""1.0""tUrBeX");
    
    
/* Para el menú de jugadores */
    
register_clcmd("change_class""myClassMenu", -1"Menú de jugadores");
    
register_menucmd(register_menuid("[ Menú de jugadores (1/2) ]"), 1023"myMenuClassCommand");
    
register_menucmd(register_menuid("[ Menú de jugadores (2/2) ]"), 1023"myMenuClass2Command");
    
/* fin menú de jugadores */
    
    
return PLUGIN_CONTINUE;
}

public 
myClassMenu(id)

    new 
szMenuBody[256];
    new 
keys;
    
    
format(szMenuBody255"[ Escoger jugador (1/2) ]^n1. [ Buu ]^n2. [ Goku ]^n3. [ Gohan ]^n4. [ Krillin ]^n5. [ Frieza ]^n6. [ Piccolo ]^n7. [ Trunks ]^n8. [ Vegeta ]^n9.[ Siguiente ]^n^n0. Salir");
    
    
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9);
    
    
show_menu(idkeysszMenuBody, -1);

    return 
PLUGIN_HANDLED;
}

public 
myMenuClassCommand(id key)    
{
    switch(
key)
    {
  case 
0:
  {
      
client_cmd(id,"buu");  
  }
  case 
1:
  {
      
client_cmd(id,"goku");  
  }
  case 
2:
  {
      
client_cmd(id,"gohan");  
  }
  case 
3:
  {
      
client_cmd(id,"krillin");  
  }
  case 
4:
  {
      
client_cmd(id,"frieza");  
  }
  case 
5:
  {
      
client_cmd(id,"piccolo");  
  }
  case 
6:
  {
      
client_cmd(id,"trunks");  
  }
  case 
7:
  {
      
client_cmd(id,"vegeta");  
  }  
  case 
8:
  {
      
myClass2Menu(id);      
  }
  case 
9client_print(idprint_chat"-");
    }    
    return 
PLUGIN_HANDLED;
}

public 
myClass2Menu(id)    
{
    new 
szMenuBody[256];
    new 
keys;
    
    
format(szMenuBody255"[ Escoger jugador (2/2) ]^n1. [ Cell ]^n2. [ OtherPlayer ]^n3. [ --- ]^n4. [ --- ]^n5. [ --- ] ^n6. [ --- ]^n7. [ --- ]^n8. [ --- ]^n9. [ Anterior ]^n^n0. Salir");
    
    
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9);
    
    
show_menu(idkeysszMenuBody, -1);
    
    return 
PLUGIN_HANDLED;
}

public 
myMenuClass2Command(id key)    

    switch(
key)    
    {
  case 
0:
  {
      
client_cmd(id,"cell");      
  }  
  case 
1:
  {
      
client_print(idprint_chat"other player");      
  }
  case 
2:
  {
      
client_print(idprint_chat"-");      
  }
  case 
3:
  {
      
client_print(idprint_chat"-");      
  }
  case 
4:
  {
      
client_print(idprint_chat"-");      
  }
  case 
5:
  {
      
client_print(idprint_chat"-");      
  }
  case 
6:
  {
      
client_print(idprint_chat"-");      
  }
  case 
7:
  {
      
client_print(idprint_chat"-");      
  }  
  case 
8:
  {
      
myClassMenu(id);
  }    
  case 
9client_print(idprint_chat"-");
    }    
    return 
PLUGIN_HANDLED;


this is a my class menu, when i press "c" (menu class) the plugin shows the menu, but.... if i press a number (any option of menu)... show a menu of add bot.... why¿?
in few words.... the plugin doesnt work correctly... only show the menu... but... if i press a option... shows the add bot menu.

any idea¿?
thanks!

Martin1 02-28-2007 18:21

Re: make a menu (ESF)
 
no entiendo porque estas apretando c, no deberias tipear change_class en consola?

turbex 02-28-2007 18:31

Re: make a menu (ESF)
 
English:
in ESF mod the "change_class" is bind to "c" key

Español:
Es que en el juego de ESF, change_class funciona precionando la C


All times are GMT -4. The time now is 00:45.

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