problema en el menu(SOLUCIONADO)
#1
hola, tengo un problema con este menu y no encuentro la falla
idea del menu: la idea es que cambie de nombre al estar activado y al estar desacitivado
osea si es de noche que diga para que sea de dia
y si es de dia que diga para q sea de noche
Cita:PROBLEMA: al copilar me dice
Warning: Function "Handle_Escondida" should return a value on line 61
codigo:
Código PHP:
new dia false
public Evento_Escondida(id)
{
    new 
texto[50]
    new 
menu menu_create("\r[ \yEvento Escondidas \r]""Handle_Escondida")
    if(!
dia)
    {
        
formatex(textocharsmax(texto), "Hacer de: \dNOCHE")
    }
    else if(
dia)
    {
        
formatex(textocharsmax(texto), "Hacer de: \yDIA")
    }
    
menu_additem(menutexto"0")
    
menu_additem(menu"Dar Arma""1"0)
    
menu_setprop(menuMPROP_EXITNAME,"Atras")
    
menu_display(idmenu0)
}
public 
Handle_Escondida(idmenuitem){
    if (
item == MENU_EXIT){
        
menu_staff2(id)
        
menu_destroy(menu)
    }
    switch(
item){
        case 
0: {
            if(!
dia)
            {
                
set_lights("a")
                
set_cvar_num("mp_flashlight"1)
                
Evento_Escondida(id)
                
dia true
            
}
            if(
dia)
            {
                
set_lights("#OFF")
                
set_cvar_num("mp_flashlight"0)
                
Evento_Escondida(id)
                
dia false
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
1client_print(idprint_chat"asd")
        }
    }
// aca me dice que es el error
    
return PLUGIN_HANDLED

Nothingdohere <===| Aprendiendo Con Cada Momento |===> Nothingdohere
<==| Aportes |==>
Sistema de Carnages + Menu para Mandarlos
Responder
#2
Código PHP:
new dia false
public Evento_Escondida(id)
{
    new 
texto[50]
    new 
menu menu_create("\r[ \yEvento Escondidas \r]""Handle_Escondida")
    
formatex(textocharsmax(texto), "Hacer de: %s"dia == true "\yDIA":"\dNOCHE")
    
menu_additem(menutexto"0")
    
menu_additem(menu"Dar Arma""1"0)
    
menu_setprop(menuMPROP_EXITNAME,"Atras")
    
menu_display(idmenu0)
}
public 
Handle_Escondida(idmenuitem)
{
    if (
item == MENU_EXIT){
        
menu_staff2(id)
        
menu_destroy(menu)
    }
    switch(
item)
    {
        case 
0
        {
            if(!
dia)
            {
                
set_lights("a")
                
set_cvar_num("mp_flashlight"1)
                
Evento_Escondida(id)
                
dia true
            
}
            if(
dia)
            {
                
set_lights("#OFF")
                
set_cvar_num("mp_flashlight"0)
                
Evento_Escondida(id)
                
dia false
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
1client_print(idprint_chat"asd")
    }
    return 
PLUGIN_HANDLED

Prueba
“Quien te quiere en su vida, volverá a buscarte”
Qué frase más estúpida
Porque quien te quiere en su vida, jamás se iría.
Responder
#3
con el metodo que me pasaste y me tira un warning
se pone en dia y despues queda en dia osea si lo preciono denuevo no vuelve a decir NOCHE

intente hacerlo asi y no me tira mas los warnings pero sigue con el problema de que al precionar denuevo no cambia
asi esta ahora
Código PHP:
new dia
public Evento_Escondida(id)
{
    new 
texto[50]
    new 
menu menu_create("\r[ \yEvento Escondidas \r]""Handle_Escondida")
    if(!
dia)
    {
        
formatex(textocharsmax(texto), "Hacer de: \dNOCHE")
    }
    else if(
dia)
    {
        
formatex(textocharsmax(texto), "Hacer de: \yDIA")
    }
    
menu_additem(menutexto"0")
    
menu_additem(menu"Dar Arma""1"0)
    
menu_setprop(menuMPROP_EXITNAME,"Atras")
    
menu_display(idmenu0)
}
public 
Handle_Escondida(idmenuitem)
{
    if (
item == MENU_EXIT){
        
menu_staff2(id)
        
menu_destroy(menu)
    }
    switch(
item)
    {
        case 
0
        {
            if(!
dia)
            {
                
set_lights("a")
                
set_cvar_num("mp_flashlight"1)
                
Evento_Escondida(id)
                
dia true
            
}
            if(
dia)
            {
                
set_lights("#OFF")
                
set_cvar_num("mp_flashlight"0)
                
Evento_Escondida(id)
                
dia false
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
1menu_armas(id)
        }
    return 
PLUGIN_HANDLED

Nothingdohere <===| Aprendiendo Con Cada Momento |===> Nothingdohere
<==| Aportes |==>
Sistema de Carnages + Menu para Mandarlos
Responder
#4
Espero te sirva!

Saludos. Crab


Código PHP:
/* Sublime AMXX Editor v3.0.0-beta */

#include < amxmodx >
#include < engine >

#pragma semicolon 1

#if AMXX_VERSION_NUM < 183

    #define client_disconected client_disconnect
    #define print_team_default 0
    #define MAX_PLAYERS 32
    #define MAX_NAME_LENGTH 32

    
stock client_print_coloriIDiFakeVar, const szInput[ ], any:... ) {

        
#pragma unused iFakeVar
        
static szMessage191 ], g_iMsgSayText;

        if( !
g_iMsgSayText )
            
g_iMsgSayText get_user_msgid"SayText" );

        
vformatszMessage190szInput);

        
message_beginiID MSG_ONE_UNRELIABLE MSG_BROADCASTg_iMsgSayText, .player iID );
        
write_byteiID iID 33 );
        
write_stringszMessage );
        
message_end( );
    }
#endif

/* GLOBAL STUFF */
new g_szPluginName[ ] = "Seeker Event Menu";
new 
g_szPluginVersion[ ] = "1.0b";
new 
g_szPluginAuthor[ ] = "Chema";

new 
g_szSayPrefix[ ] = "^3[Kohoutek Gaming]^1";
new 
g_szConsolePrefix[ ] = "[Kohoutek Gaming]";
new 
g_szContactUrl[ ] = "www.amxmodx-es.com/Chema";

new const 
g_szSelectItemSound[ ] = "Ui/buttonclickrelease.wav";

new 
g_bDay;

public 
plugin_init( ) {

    
register_pluging_szPluginNameg_szPluginVersiong_szPluginAuthor );
    
    
/* Plugin Cvars */
    
register_cvar"sem_author"g_szPluginAuthorFCVAR_SPONLY );

    
/* Client-related Stuff */
    
register_clcmd"say /event""ShowSeekerEventMenu" );

    
g_bDay false;
}

/* Seeker Event Menu */
public ShowSeekerEventMenu( const iID ) {

    new 
iMenu menu_create"\ySeeker Event Menu^n^n\yIn this mode you have to hide from the \wCT's""HandlerSeekerEventMenu" );

    
menu_additemiMenug_bDay "Make \yDAY" "Make \dNIGHT" );
    
menu_additemiMenu"Give weapons" );

    
menu_displayiIDiMenu);
}

public 
HandlerSeekerEventMenu( const iID, const iMenu, const iItem ) {

    if( 
iItem == MENU_EXIT ) {

        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }

    switch( 
iItem ) {

        case 
0: {

            
g_bDay =! g_bDay;
            
g_bDay set_lights"a" ) : set_lights"#OFF" );
            
g_bDay set_cvar_num"mp_flashlight") : set_cvar_num"mp_flashlight");
        }
        case 
1client_printiIDprint_chat"%s GIVE WEAPONS!"g_szConsolePrefix );
    }

    
ShowSeekerEventMenuiID );
    
client_cmdiID"spk ^"%s^""g_szSelectItemSound );

    return 
PLUGIN_HANDLED;

Responder
#5
gracias chema me sirvio
logre adaptarlo y
ME QUEDO ASI
Código PHP:
public Evento_Escondida(id)
{
    new 
texto[50]
    new 
menu menu_create("\r[ \yEvento Escondidas \r]""Handle_Escondida")
    if(!
dia)
    {
        
formatex(textocharsmax(texto), "Hacer de: \dNOCHE")
    }
    else if(
dia)
    {
        
formatex(textocharsmax(texto), "Hacer de: \yDIA")
    }
    
menu_additem(menutexto"0")
    
menu_additem(menu"Dar Arma""1"0)
    
menu_setprop(menuMPROP_EXITNAME,"Atras")
    
menu_display(idmenu0)
}
public 
Handle_Escondida(idmenuitem)
{
    if (
item == MENU_EXIT){
        
menu_staff2(id)
        
menu_destroy(menu)
    }
    switch(
item)
    {
        case 
0
        {
            
dia =! dia;
            
//g_bDay ? set_lights( "a" ) : set_lights( "#OFF" );
            
dia set_lights("a") : set_lights("#OFF")
            
dia set_cvar_num("mp_flashlight"1) : set_cvar_num("mp_flashlight"0)
            
Evento_Escondida(id)
        }
        case 
1menu_armas(id)
        }
    return 
PLUGIN_HANDLED

Nothingdohere <===| Aprendiendo Con Cada Momento |===> Nothingdohere
<==| Aportes |==>
Sistema de Carnages + Menu para Mandarlos
Responder
#6
De nada.

Que horrible styling pacman, con lo prolijo que lo había dejado yo RagestartRoflmao

Saludos. Crab
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)