Raised This Month: $51 Target: $400
 12% 

[ES]Porfavor me disen porq no funca


  
 
 
Thread Tools Display Modes
Author Message
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 07-06-2010 , 17:35   [ES]Porfavor me disen porq no funca
#1

Me pueden decir bien porq no funca?
El problema es q cuando escrivo por say para activar el menu seme tilda el cs
me lo compila lo mas bien

Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Prueba"
#define VERSION "1.0"
#define AUTHOR "Destro"
public plugin_init() 
{  
 register_plugin(PLUGIN, VERSION, AUTHOR)
 
 register_clcmd("say anda", "show_mensaje")
 register_clcmd("say /anda", "show_mensaje")
 register_clcmd("say anda", "show_menu_prueba")
 register_clcmd("say /anda", "show_menu_prueba")
}
new anda
public show_mensaje(id)
{
     if( anda < 2 )
     { 
        while( anda < 2 )
        { 
         set_hudmessage(000, 255, 000, 0.059, 0.5, 0, 6.0, 1.0)
         show_hudmessage(id, "primera opcion")
        }
      }
      else if( anda > 2 )
      {
 anda = 1
      }
}
public show_menu_prueba(id)
{     
 
 
 new menu = menu_create("\rMenu de prueba", "menu_prueba")
 
 menu_additem(menu, "uno", "1", 0);
 menu_additem(menu, "dos", "2", 0);
 menu_additem(menu, "\ytres", "3", 0);
 
 menu_setprop(menu, MPROP_EXITNAME, "Salir")
 menu_display(id, menu, 0) 
}
public menu_prueba(id, menu, item)
{
 if(item == MENU_EXIT)
 {
  menu_destroy(menu);
  return PLUGIN_HANDLED;
 }
 
 new data[6], iName[64], access, callback
 menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)
 
 switch(str_to_num(data))
 {
  case 1:
  {
   client_print(id, print_chat, "Seleccionaste la primer opcion del menu")
 
   if( anda < 2 )
   {
       anda = 3
   }
 
  }
  case 2:
  {
   client_print(id, print_chat, "Seleccionaste la segunda opcion del menu")
  }
  case 3:
  {
   client_print(id, print_chat, "Seleccionaste la tercer opcion del menu")
  }
 } 
 menu_destroy(menu)
 return PLUGIN_HANDLED
}
grax de ante mano

Last edited by Destro-; 07-06-2010 at 20:50.
Destro- is offline
Old 07-06-2010, 17:38
PattyBiena
This message has been deleted by Kiske.
Old 07-06-2010, 17:44
Destro-
This message has been deleted by Kiske.
Old 07-06-2010, 17:46
razorX2
This message has been deleted by Kiske.
Old 07-06-2010, 17:50
Destro-
This message has been deleted by Kiske.
Zapdos1
BANNED
Join Date: Jul 2009
Location: Chile - La Serena
Old 07-06-2010 , 17:55   Re: [ES]Porq no funciona
#2

perdon, que se supone que quieres hacer?

para que agregas la constante anda? xd
Zapdos1 is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 07-06-2010 , 18:02   Re: [ES]Porq no funciona
#3

ya lo dije arriba
Destro- is offline
PattyBiena
BANNED
Join Date: Jul 2010
Location: Argentina
Old 07-06-2010 , 18:05   Re: [ES]Porq no funciona
#4

PHP Code:
#include <amxmodx>
#include <amxmisc>

new menu

public plugin_init() 
{  
    
register_clcmd("say anda""show_menu_prueba")
    
register_clcmd("say /anda""show_menu_prueba")
}
public 
show_mensaje(idkey)
{
    
set_hudmessage(025500.0590.506.01.0)
    
    
/* Si queres Hacer Esto para mensajes especiales x menu
    switch(key)
    {
        case 1: show_hudmessage(id, "primera opcion")
        case 2: show_hudmessage(id, "segunda opcion")
        case 3: show_hudmessage(id, "tercer opcion")
    }*/
    
    // Si solo queres que diga la opcion
    
show_hudmessage(id"Opcion: %d"key)
    
}
public 
show_menu_prueba(id)
{
    
menu menu_create("\rMenu de prueba""menu_prueba")
    
    
menu_additem(menu"uno""1"0);
    
menu_additem(menu"dos""2"0);
    
menu_additem(menu"tres""3"0);

    
menu_setprop(menuMPROP_EXITNAME"Salir")
    
menu_display(idmenu0
    
}
public 
menu_prueba(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], iName[64], accesscallback
    menu_item_getinfo
(menuitemaccessdata5iName63callback)
    
    
show_mensaje(idstr_to_num(data))
    
    switch(
str_to_num(data))
    {
        case 
1client_print(idprint_chat"Seleccionaste la primer opcion del menu")
        case 
2client_print(idprint_chat"Seleccionaste la segunda opcion del menu")
        case 
3client_print(idprint_chat"Seleccionaste la tercer opcion del menu")
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED

PattyBiena is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 07-06-2010 , 18:39   Re: [ES]Porq no funciona
#5

hay ta pero igual no anda

Last edited by Destro-; 07-06-2010 at 19:14.
Destro- is offline
Old 07-06-2010, 21:33
Destro-
This message has been deleted by Alucard^.
PattyBiena
BANNED
Join Date: Jul 2010
Location: Argentina
Old 07-06-2010 , 21:42   Re: [ES]Porfavor me disen porq no funca
#6

No entiendo por q no anda, maņana me fijo y lo testeo.
PattyBiena is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 07-06-2010 , 22:08   Re: [ES]Porfavor me disen porq no funca
#7

bueno,porq me puse a "estudiar se podria decir" como loco,y me da bronca q mi primer plugin q toy casi seguro q tendria q andar no ande.
grax
Destro- is offline
minato
Senior Member
Join Date: May 2010
Location: Rosario
Old 07-06-2010 , 22:22   Re: [ES]Porfavor me disen porq no funca
#8

PHP Code:
        register_clcmd("say anda""show_mensaje")
    
register_clcmd("say /anda""show_mensaje")
    
register_clcmd("say anda""show_menu_prueba")
    
register_clcmd("say /anda""show_menu_prueba"
estas poniendo un mismo comando para 2 opciones
minato is offline
Send a message via MSN to minato
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 07-06-2010 , 22:26   Re: [ES]Porfavor me disen porq no funca
#9

si,pero anda igual,antes de poner el loop andava:andava como un hud normal q dependia del tiempo,no como lo q qiero aser
Destro- is offline
LittleBody
BANNED
Join Date: Apr 2010
Old 07-06-2010 , 23:35   Re: [ES]Porfavor me disen porq no funca
#10

Code:
#include <amxmodx> new const Opciones[3][] = { "Opcion 1", "Opcion 2", "Opcion 3" } public plugin_init() {      register_plugin( "Prueba", "1.0", "Destro" )         register_clcmd("say anda", "ShowMenuMensaje")     register_clcmd("say /anda", "ShowMenuMensaje") } public ShowMensaje( id, Key ) {     switch( Key )     {         case 0: Key = 1         case 1: Key = 2         case 2: Key = 3     }         set_hudmessage(0, 255, 0, 0.059, 0.5, 0, 6.0, 1.0)     show_hudmessage(id, "Opcion: %d", Key) } public ShowMenuMensaje(id) {      new Menu = menu_create("Menu de prueba", "HandleMenuPrueba")         static i, iNum[ 10 ]     for(i = 0; i <  sizeof( Opciones ); i++)     {         num_to_str( i, iNum, 9 )         menu_additem( Menu, Opciones[i], iNum, 0 )     }         menu_setprop(Menu, MPROP_EXITNAME, "Salir")     menu_display(id, Menu, 0) } public HandleMenuPrueba(id, Menu, item) {     if(item == MENU_EXIT)         return PLUGIN_HANDLED;         new Data[6], iName[64], _access, callback     menu_item_getinfo( Menu, item, _access, Data, 5, iName, 63, callback )         new Key = str_to_num( Data )         ShowMensaje( id, Key )     switch( Key )     {         case 0: client_print(id, print_chat, "Seleccionaste la primera opcion del menu")         case 1: client_print(id, print_chat, "Seleccionaste la segunda opcion del menu")         case 2: client_print(id, print_chat, "Seleccionaste la tercera opcion del menu")     }     return PLUGIN_HANDLED; }
LittleBody is offline
 



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 19:48.


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