Raised This Month: $32 Target: $400
 8% 

[ZP][Ayuda] Ayuda con menu de granadas


  
 
 
Thread Tools Display Modes
KermesS
Senior Member
Join Date: Jan 2013
Location: Amsterdam
Old 02-27-2013 , 23:21   Re: [ZP][Ayuda] Ayuda con menu de granadas
#31

Quote:
Originally Posted by XxDioSxX View Post
lo malo tambien para tener el campo tube q sacar la granada de luz totalmente...
Y eso porque?
Yo utilizo la forma de Fail! y no la tuve que quitar para nada, simplemente añadi la nueva, si tenes algun problema simplemente hubieras preguntado, no hay necesidad de eliminarla D:
KermesS is offline
Matians
Veteran Member
Join Date: Nov 2010
Location: ME QUIEREN ROBAR
Old 02-27-2013 , 23:21   Re: [ZP][Ayuda] Ayuda con menu de granadas
#32

Eso es simplemente porque, seguro hiciste copy paste, si haces copy paste del tutorial de la bubble te da muchos warnings y un par de errores.

Si lo volveos a hacer y posteas los errores, y usas if (g_bubble_camp[id]) y el else, podes, te lo aseguro.
Matians is offline
XxDioSxX
Senior Member
Join Date: Nov 2012
Location: argentina
Old 02-27-2013 , 23:31   Re: [ZP][Ayuda] Ayuda con menu de granadas
#33

Quote:
Originally Posted by Matians View Post
Eso es simplemente porque, seguro hiciste copy paste, si haces copy paste del tutorial de la bubble te da muchos warnings y un par de errores.

Si lo volveos a hacer y posteas los errores, y usas if (g_bubble_camp[id]) y el else, podes, te lo aseguro.
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Header size: 10400 bytes
Code size: 436180 bytes
Data size: 344952 bytes
Stack/heap size: 16384 bytes; max. usage is unknown, due to recursion
Total requirements: 807916 bytes
Done.

0 ERRORES MAN.... tengo barias ideas para erreglar ese problema, pero tambien ando viendo armas mejoradas y no me da el cuero para todo...
XxDioSxX is offline
Send a message via MSN to XxDioSxX Send a message via Skype™ to XxDioSxX
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 02-27-2013 , 23:32   Re: [ZP][Ayuda] Ayuda con menu de granadas
#34

yo ni uso el sistema de fail es un consumo al dope, la codie desde 0, para mi es mejor sacarla de la recopilacion pero veo que varios aca la necesitan.

matians tu como sabes que el hizo copy-paste?
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
Matians
Veteran Member
Join Date: Nov 2010
Location: ME QUIEREN ROBAR
Old 02-27-2013 , 23:35   Re: [ZP][Ayuda] Ayuda con menu de granadas
#35

Nunca me dijo que no ¬¬ Ademas porque cuando yo empece (como casi todos ca) hice copy-paste y no podía usar la bubble, me tiraba error, no al compilar, sino al usarla, logs, etc, etc.

Cuando aprendí, la hice bien, sin copy paste y me anduvo y sin sacar la luz.
Matians is offline
XxDioSxX
Senior Member
Join Date: Nov 2012
Location: argentina
Old 02-27-2013 , 23:36   Re: [ZP][Ayuda] Ayuda con menu de granadas
#36

Quote:
Originally Posted by KermesS View Post
Y eso porque?
Yo utilizo la forma de Fail! y no la tuve que quitar para nada, simplemente añadi la nueva, si tenes algun problema simplemente hubieras preguntado, no hay necesidad de eliminarla D:
kermes como tenes puesta la entidad de la bomba de fail???? osea yo le cambie todo a campo... donde decia NADE_TYPE_NAPALM yo le cambie a NADE_TYPE_CAMPO...

Last edited by XxDioSxX; 02-27-2013 at 23:37.
XxDioSxX is offline
Send a message via MSN to XxDioSxX Send a message via Skype™ to XxDioSxX
KermesS
Senior Member
Join Date: Jan 2013
Location: Amsterdam
Old 02-27-2013 , 23:55   Re: [ZP][Ayuda] Ayuda con menu de granadas
#37

Quote:
Originally Posted by XxDioSxX View Post
kermes como tenes puesta la entidad de la bomba de fail???? osea yo le cambie todo a campo... donde decia NADE_TYPE_NAPALM yo le cambie a NADE_TYPE_CAMPO...
PHP Code:
public fw_ThinkGrenade(entity)
{
    
// Invalid entity
    
if (!pev_valid(entity)) return HAM_IGNORED;
    
    
// Get damage time of grenade
    
static Float:dmgtimeFloat:current_time
    pev
(entitypev_dmgtimedmgtime)
    
current_time get_gametime()
    
    
// Check if it's time to go off
    
if (dmgtime current_time)
        return 
HAM_IGNORED;
    
    
// Check if it's one of our custom nades
    
switch (pev(entityPEV_NADE_TYPE))
    {
        case 
NADE_TYPE_INFECTION// Infection Bomb
        
{
            
infection_explode(entity)
            return 
HAM_SUPERCEDE;
        }
        case 
NADE_TYPE_NAPALM// Napalm Grenade
        
{
            
fire_explode(entity)
            return 
HAM_SUPERCEDE;
        }
        case 
NADE_TYPE_FROST// Frost Grenade
        
{
            
frost_explode(entity)
            return 
HAM_SUPERCEDE;
        }
                       case 
NADE_TYPE_CAMPO:
        {
                           static 
duration
                    duration 
pev(entityPEV_FLARE_DURATION)
            
                    
// Already went off, do lighting loop for the duration of PEV_FLARE_DURATION
                    
if (duration 0)
                    {
                        
// Check whether this is the last loop
                    
if (duration == 1)
                    {
                        
// Get rid of the flare entity
                        
engfunc(EngFunc_RemoveEntityentity)
                        return 
HAM_SUPERCEDE;
                    }
                
                    
bubble_explode(entity
                
                        
// Set time for next loop
                    
set_pev(entityPEV_FLARE_DURATION, --duration)
                    
set_pev(entitypev_dmgtimecurrent_time 5.0)
                    }
                    
// Light up when it's stopped on ground
                    
else if ((pev(entitypev_flags) & FL_ONGROUND) && fm_get_speed(entity) < 10)
                    {
                    
// Flare sound
                    
static sound[64]
                    
ArrayGetString(grenade_flarerandom_num(0ArraySize(grenade_flare) - 1), soundcharsmax(sound))
                    
emit_sound(entityCHAN_WEAPONsound1.0ATTN_NORM0PITCH_NORM)
                
                    
// Set duration and start lightning loop on next think
                    
set_pev(entityPEV_FLARE_DURATIONget_pcvar_num(cvar_flareduration)/5)
                    
set_pev(entitypev_dmgtimecurrent_time 0.1)
                    }
                    else
                    {
                    
// Delay explosion until we hit ground
                    
set_pev(entitypev_dmgtimecurrent_time 0.5)
                    }
        }
        case 
NADE_TYPE_FLARE// Flare
        
{
            
// Get its duration
            
static duration
            duration 
pev(entityPEV_FLARE_DURATION)
            
            
// Already went off, do lighting loop for the duration of PEV_FLARE_DURATION
            
if (duration 0)
            {
                
// Check whether this is the last loop
                
if (duration == 1)
                {
                    
// Get rid of the flare entity
                    
engfunc(EngFunc_RemoveEntityentity)
                    return 
HAM_SUPERCEDE;
                }
                
                
// Light it up!
                
flare_lighting(entityduration)
                
                
// Set time for next loop
                
set_pev(entityPEV_FLARE_DURATION, --duration)
                
set_pev(entitypev_dmgtimecurrent_time 5.0)
            }
            
// Light up when it's stopped on ground
            
else if ((pev(entitypev_flags) & FL_ONGROUND) && fm_get_speed(entity) < 10)
            {
                
// Flare sound
                
static sound[64]
                
ArrayGetString(grenade_flarerandom_num(0ArraySize(grenade_flare) - 1), soundcharsmax(sound))
                
emit_sound(entityCHAN_WEAPONsound1.0ATTN_NORM0PITCH_NORM)
                
                
// Set duration and start lightning loop on next think
                
set_pev(entityPEV_FLARE_DURATIONget_pcvar_num(cvar_flareduration)/5)
                
set_pev(entitypev_dmgtimecurrent_time 0.1)
            }
            else
            {
                
// Delay explosion until we hit ground
                
set_pev(entitypev_dmgtimecurrent_time 0.5)
            }
        }
    }
    
    return 
HAM_IGNORED;

No estara codeado de la mejor forma pero funciona perfectamente :p
KermesS is offline
ChileScripting
BANNED
Join Date: Jan 2013
Old 02-28-2013 , 02:24   Re: [ZP][Ayuda] Ayuda con menu de granadas
#38

Usen variables no bools para las granadas asi setean las granadas por cantidad no por verdadero y falso ;).

Otra cosa ya que esta de moda esto del enum aca les dejo un code que tenia por ahi.

Aunque ya ni lo uso pero aqui esta XD.

PHP Code:
enum _:Granada_Data 
{
    
WeaponName[85],
    
NivelReq,
    
ResetReq,
    
Granada_1,
    
Granada_2,
    
Granada_3
}


new const 
gGranadas[][Granada_Data] = 

    { 
"1 Fuego - 1 Hielo - 1 Luz"0011},
    { 
"1 Fuego - 1 Hielo - 2 Luz"25011},
    { 
"1 Fuego - 2 Hielo - 1 Luz"50021},
    { 
"2 Fuego - 2 Hielo - 2 Luz"75022},
    { 
"1 Molotov - 2 Hielo - 1 Luz"100012},
    { 
"1 Molotov - 2 Hielo - 1 Burbuja"125012}
}

public 
Menu_Granadas(id)
{
    new 
len[600] , temp[16]
   
    if(
can_buy(id))
        return 
PLUGIN_HANDLED
       
    
if(!g_canbuy_tri[id])
        return 
PLUGIN_HANDLED
   
    menu_granadas 
menu_create("\yElige Armamento Extra" "Menu_Granadas_Cases")
   
    for(new 
sizeof gGranadas i++)
    {
        if (
g_level[id] >= gGranadas[i][NivelReq] && g_reset[id] >= gGranadas[i][ResetReq])
            
formatex(lencharsmax(len), "[%s] \y[Disponible]"gGranadas[i][WeaponName])
        else
            
formatex(lencharsmax(len), "[%s] \r[Nivel:\y %d\w |\r RT:\y %d\r]"gGranadas[i][WeaponName], gGranadas[i][NivelReq], gGranadas[i][ResetReq])
           
        
num_to_str(i,temp2)
        
menu_additem(menu_granadas len temp)
    }
           
    
menu_setprop(menu_granadas MPROP_BACKNAME,"Atras")
    
menu_setprop(menu_granadas MPROP_NEXTNAME,"Siguiente")
    
menu_setprop(menu_granadas MPROP_EXITNAME,"Salir")
    
menu_display(idmenu_granadas page)
   
    return 
PLUGIN_HANDLED
}

public 
Menu_Granadas_Cases(id menu_granadas item)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu_granadas)
        return 
PLUGIN_HANDLED
    
}
       
    new 
page armas_2
    player_menu_info
(id menu_granadas armas_2)
   
    if(
g_level[id] < gGranadas[item][NivelReq])
    {   
        
zp_colored_print(id"%s Para elegir la^x04 %s^x01 necesitas ser^x04 Nivel^x01:^x04 %d^x01."TAGgGranadas[item][WeaponName], gGranadas[item][NivelReq])
        
Menu_Granadas(id
        return 
PLUGIN_HANDLED
    
}
    if(
g_reset[id] < gGranadas[item][ResetReq])
    {   
        
zp_colored_print(id"%s Para elegir la^x04 %s^x01 necesitas tener^x01:^x04 %d^x03 Resets."TAGgGranadas[item][WeaponName], gGranadas[item][ResetReq])
        
Menu_Granadas(id
        return 
PLUGIN_HANDLED
    
}
   
    
drop_weapons(id 3)
    
fm_give_item(id"weapon_hegrenade")
    
fm_give_item(id"weapon_flashbang")
    
fm_give_item(id"weapon_smokegrenade")
    
cs_set_user_bpammo(idCSW_HEGRENADEgGranadas[item][Granada_1])
    
cs_set_user_bpammo(idCSW_FLASHBANGgGranadas[item][Granada_2])
    
cs_set_user_bpammo(idCSW_SMOKEGRENADEgGranadas[item][Granada_3])

    
// Ejemplos para agregar variables aca abajo obtienen el item chequean si es igual y otorgan permisos...
    
if(item == 4// si es la opcion numero 4
        
gVariableNade[id]++ // agregar una variable sumada +1
    
    
return PLUGIN_HANDLED

ChileScripting is offline
Bernii
BANNED
Join Date: Feb 2013
Location: Weed Land *-*
Old 02-28-2013 , 02:47   Re: [ZP][Ayuda] Ayuda con menu de granadas
#39

PHP Code:
// Humano,Zombie,Nemesis etc Este vivo le muestra el menu.
        
if (!g_isalive[id])
        
show_menu_buy3(id)
            return 
PLUGIN_HANDLED
El primer menu esque si los zombies,weskers,sniper etc no lo puedan cojer.

Y el que te puse ahi es otro aparte para que cuando el humano,zombie etc este vivo le salga el menu.
Y como ja pusiste el otro para que solo le de al humano ja deve ser esa tu [Solución]

Last edited by Bernii; 02-28-2013 at 02:50.
Bernii is offline
GokuX
BANNED
Join Date: Jun 2011
Location: Quilpué , Chile
Old 02-28-2013 , 03:13   Re: [ZP][Ayuda] Ayuda con menu de granadas
#40

Quote:
Originally Posted by ChileScripting View Post
Usen variables no bools para las granadas asi setean las granadas por cantidad no por verdadero y falso ;).

Otra cosa ya que esta de moda esto del enum aca les dejo un code que tenia por ahi.

Aunque ya ni lo uso pero aqui esta XD.

PHP Code:
enum _:Granada_Data 
{
    
WeaponName[85],
    
NivelReq,
    
ResetReq,
    
Granada_1,
    
Granada_2,
    
Granada_3
}


new const 
gGranadas[][Granada_Data] = 

    { 
"1 Fuego - 1 Hielo - 1 Luz"0011},
    { 
"1 Fuego - 1 Hielo - 2 Luz"25011},
    { 
"1 Fuego - 2 Hielo - 1 Luz"50021},
    { 
"2 Fuego - 2 Hielo - 2 Luz"75022},
    { 
"1 Molotov - 2 Hielo - 1 Luz"100012},
    { 
"1 Molotov - 2 Hielo - 1 Burbuja"125012}
}

public 
Menu_Granadas(id)
{
    new 
len[600] , temp[16]
   
    if(
can_buy(id))
        return 
PLUGIN_HANDLED
       
    
if(!g_canbuy_tri[id])
        return 
PLUGIN_HANDLED
   
    menu_granadas 
menu_create("\yElige Armamento Extra" "Menu_Granadas_Cases")
   
    for(new 
sizeof gGranadas i++)
    {
        if (
g_level[id] >= gGranadas[i][NivelReq] && g_reset[id] >= gGranadas[i][ResetReq])
            
formatex(lencharsmax(len), "[%s] \y[Disponible]"gGranadas[i][WeaponName])
        else
            
formatex(lencharsmax(len), "[%s] \r[Nivel:\y %d\w |\r RT:\y %d\r]"gGranadas[i][WeaponName], gGranadas[i][NivelReq], gGranadas[i][ResetReq])
           
        
num_to_str(i,temp2)
        
menu_additem(menu_granadas len temp)
    }
           
    
menu_setprop(menu_granadas MPROP_BACKNAME,"Atras")
    
menu_setprop(menu_granadas MPROP_NEXTNAME,"Siguiente")
    
menu_setprop(menu_granadas MPROP_EXITNAME,"Salir")
    
menu_display(idmenu_granadas page)
   
    return 
PLUGIN_HANDLED
}

public 
Menu_Granadas_Cases(id menu_granadas item)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu_granadas)
        return 
PLUGIN_HANDLED
    
}
       
    new 
page armas_2
    player_menu_info
(id menu_granadas armas_2)
   
    if(
g_level[id] < gGranadas[item][NivelReq])
    {   
        
zp_colored_print(id"%s Para elegir la^x04 %s^x01 necesitas ser^x04 Nivel^x01:^x04 %d^x01."TAGgGranadas[item][WeaponName], gGranadas[item][NivelReq])
        
Menu_Granadas(id
        return 
PLUGIN_HANDLED
    
}
    if(
g_reset[id] < gGranadas[item][ResetReq])
    {   
        
zp_colored_print(id"%s Para elegir la^x04 %s^x01 necesitas tener^x01:^x04 %d^x03 Resets."TAGgGranadas[item][WeaponName], gGranadas[item][ResetReq])
        
Menu_Granadas(id
        return 
PLUGIN_HANDLED
    
}
   
    
drop_weapons(id 3)
    
fm_give_item(id"weapon_hegrenade")
    
fm_give_item(id"weapon_flashbang")
    
fm_give_item(id"weapon_smokegrenade")
    
cs_set_user_bpammo(idCSW_HEGRENADEgGranadas[item][Granada_1])
    
cs_set_user_bpammo(idCSW_FLASHBANGgGranadas[item][Granada_2])
    
cs_set_user_bpammo(idCSW_SMOKEGRENADEgGranadas[item][Granada_3])

    
// Ejemplos para agregar variables aca abajo obtienen el item chequean si es igual y otorgan permisos...
    
if(item == 4// si es la opcion numero 4
        
gVariableNade[id]++ // agregar una variable sumada +1
    
    
return PLUGIN_HANDLED


Entren eso de verdadero o falso / 1 o 0 es la misma cosa xD sin bool igual se puede verdadero o falso xDD
GokuX 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 07:51.


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