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

[ZP] Problema con granada de aniquilación


  
 
 
Thread Tools Display Modes
Author Message
TecnoZP
BANNED
Join Date: Jun 2012
Location: Buenos Aires, Argentina
Old 08-13-2012 , 12:53   [ZP] Problema con granada de aniquilación
#1

Bueno, me paso por acá porque estaba probando hacer una granada de aniquilación, esta me salió bien, pero mi problema es que quiero que se pueda utilizar a partir del nivel 150, yo probé de la siguiente forma y no funcionó:

PHP Code:
            if (g_level[id] >= 150[pev(entitypev_owner)]) // - Granada de aniquilación
            
{
                
// Give it a glow
                
fm_set_rendering(entitykRenderFxGlowShell20000kRenderNormal16);
                
                
// And a colored trail
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
write_byte(TE_BEAMFOLLOW// TE id
                
write_short(entity// entity
                
write_short(g_trailSpr// sprite
                
write_byte(10// life
                
write_byte(10// width
                
write_byte(200// r
                
write_byte(200// g
                
write_byte(0// b
                
write_byte(200// brightness
                
message_end()
            
                
// Set grenade type on the thrown grenade entity
                
set_pev(entityPEV_NADE_TYPENADE_TYPE_ANIQUILACION)
            }
        } 
Alguien me puede decir como tendría que hacer ?

Last edited by TecnoZP; 08-13-2012 at 12:54.
TecnoZP is offline
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-13-2012 , 12:58   Re: [ZP] Problema con granada de aniquilación
#2

PHP Code:
(g_level[id] >= 150[pev(entitypev_owner)]) 
??? No querras haber puesto algo asi?
PHP Code:
(g_level[id] >= 150 && pev(entitypev_owner)) 
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
TecnoZP
BANNED
Join Date: Jun 2012
Location: Buenos Aires, Argentina
Old 08-13-2012 , 13:06   Re: [ZP] Problema con granada de aniquilación
#3

Tu forma me tira estos errores:

Error: Invalid expression, assumed zero on line 3067
Error: Invalid expression, assumed zero on line 3067
Error: Expected token: ";", but found "]" on line 3067
Error: Too many error messages on one line on line 3067

La línea 3067 es esta: (g_level[id] >= 150 && pev(entity, pev_owner))

Last edited by TecnoZP; 08-13-2012 at 13:06.
TecnoZP is offline
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-13-2012 , 13:33   Re: [ZP] Problema con granada de aniquilación
#4

Ponme la funcion entera
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
TecnoZP
BANNED
Join Date: Jun 2012
Location: Buenos Aires, Argentina
Old 08-13-2012 , 13:41   Re: [ZP] Problema con granada de aniquilación
#5

Te pongo el public más facil:

PHP Code:
public fw_SetModel(entity, const model[], id)
{
    
// Remove weapons?
    
if (get_pcvar_float(cvar_removedropped) > 0.0)
    {
        
// Get entity's classname
        
static class[10]
        
pev(entitypev_classname, class, sizeof class - 1)
        
        
// Check if it's a weapon box
        
if (equal(class, "weaponbox"))
        {
            
// They get automatically removed when thinking
            
set_pev(entitypev_nextthinkget_gametime() + get_pcvar_float(cvar_removedropped))
            return;
        }
    }
    
    
// Get damage time of grenade
    
static Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    
    
// Grenade not yet thrown
    
if (dmgtime == 0.0)
        return;
    
    if (
equal(model[7], "w_he"4))
    {
        if (
g_zombie[pev(entitypev_owner)]) // [ZOMBIE] - Infection Grenade
        
{
            
// Give it a glow
            
fm_set_rendering(entitykRenderFxGlowShell02550kRenderNormal1);
            
            
// And a colored trail
            
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
write_byte(TE_BEAMFOLLOW// TE id
            
write_short(entity// entity
            
write_short(g_trailSpr// sprite
            
write_byte(10// life
            
write_byte(10// width
            
write_byte(0// r
            
write_byte(150// g
            
write_byte(0// b
            
write_byte(255// brightness
            
message_end()
            
            
// Set grenade type on the thrown grenade entity
            
set_pev(entityPEV_NADE_TYPENADE_TYPE_INFECTION)
        }
                 else
if (
get_pcvar_num(cvar_firegrenades)) // [HUMAN] - Fire Grenade
        
{
if (
g_level[id] >= 150[pev(entitypev_owner)])
            {
                
// Give it a glow
                
fm_set_rendering(entitykRenderFxGlowShell20000kRenderNormal16);
                
                
// And a colored trail
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
write_byte(TE_BEAMFOLLOW// TE id
                
write_short(entity// entity
                
write_short(g_trailSpr// sprite
                
write_byte(10// life
                
write_byte(10// width
                
write_byte(200// r
                
write_byte(200// g
                
write_byte(0// b
                
write_byte(200// brightness
                
message_end()
            
                
// Set grenade type on the thrown grenade entity
                
set_pev(entityPEV_NADE_TYPENADE_TYPE_ANIQUILACION)
            }
        }
            else
            {
                
// Give it a glow
                
fm_set_rendering(entitykRenderFxGlowShell20000kRenderNormal16);
                
                
// And a colored trail
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
write_byte(TE_BEAMFOLLOW// TE id
                
write_short(entity// entity
                
write_short(g_trailSpr// sprite
                
write_byte(10// life
                
write_byte(10// width
                
write_byte(200// r
                
write_byte(0// g
                
write_byte(0// b
                
write_byte(200// brightness
                
message_end()
                
                
// Set grenade type on the thrown grenade entity
                
set_pev(entityPEV_NADE_TYPENADE_TYPE_NAPALM)
            }
            
// Give it a glow
            
fm_set_rendering(entitykRenderFxGlowShell25500kRenderNormal1);
            
            
// And a colored trail
            
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
write_byte(TE_BEAMFOLLOW// TE id
            
write_short(entity// entity
            
write_short(g_trailSpr// sprite
            
write_byte(10// life
            
write_byte(10// width
            
write_byte(255// r
            
write_byte(0// g
            
write_byte(0// b
            
write_byte(255// brightness
            
message_end()
            
            
// Set grenade type on the thrown grenade entity
            
set_pev(entityPEV_NADE_TYPENADE_TYPE_NAPALM)
        }
    } 
TecnoZP is offline
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-13-2012 , 13:44   Re: [ZP] Problema con granada de aniquilación
#6

Funcion => public
PHP Code:
if (g_level[id] >= 150 && g_zombie[pev(entitypev_owner)]) 
La granada es de zombie? Si no lo es, creo que con:
PHP Code:
if (g_level[id] >= 150
Llega
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
TecnoZP
BANNED
Join Date: Jun 2012
Location: Buenos Aires, Argentina
Old 08-13-2012 , 14:02   Re: [ZP] Problema con granada de aniquilación
#7

Ahora tengo 2 errores:

Error: Undefined symbol "aniquilacion_explode" on line 3252
Error: Undefined symbol "aniquilacion_explode" on line 7773

Pero me fijé y está todo en orden no se porque esos errores:

PHP Code:
    switch (pev(entityPEV_NADE_TYPE))
    {
        case 
NADE_TYPE_INFECTION// Infection Bomb
        
{
            
infection_explode(entity)
        }
        case 
NADE_TYPE_NAPALM// Napalm Grenade
        
{
            
fire_explode(entity)
        }
        case 
NADE_TYPE_ANIQUILACION// Granada Aniquilacion
        
{
            
aniquilacion_explode(entity)
        }
        case 
NADE_TYPE_FROST// Frost Grenade
        
{
            
frost_explode(entity)
        }
        case 
NADE_TYPE_FLARE// Flare and Bubble 
y despues el otro:

PHP Code:
// Aniquilacion Grenade Explosion
        
aniquilacion_explode(ent)
        {
        
// Toma el origen de la greanda
        
static Float:originF[3]
        
pev(entpev_originoriginF)
        
        
// Este es el efecto de la explosion (color de la onda expansiva , esa tipo de onda expansiba
        // recomiendo no modificarla
        
create_blast2(originF)
        
        
// Este es el sonido de la explosion
        
engfunc(EngFunc_EmitSoundentCHAN_WEAPONgrenade_fire[random_num(0sizeof grenade_fire 1)], 1.0ATTN_NORM0PITCH_NORM)
        
        
// Esto  son la varaibles para despues detectar a la victima
        
static victim
        victim 
= -1
        
        
// Esto se activara si la victima esta en el radio indicado en la constante
        
while ((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFNADE_EXPLOSION_RADIUS)) != 0)
        {
            
// Aca es para ponerle condiciones , es decir, que este vivo, que no sea zombie y demas
            
if (!is_user_alive(victim) || !g_zombie[victim])
                continue;
                
                
// Aca esta el dmg este tipo de dmg es para que valla bajando de apoco la vida pero de apoco
                 
message_begin(MSG_ONE_UNRELIABLEg_msgDamage_victim)
                
write_byte(0// damage save
                
write_byte(0// damage take
                
write_long(DMG_BURN// damage type
                
write_coord(0// x
                
write_coord(0// y
                
write_coord(0// z
                
message_end()
                                
            }
            
            
// Esto remueve la entidad
            
engfunc(EngFunc_RemoveEntityent)
        }
        
        
// Our task params
        
static params[1]
        
        if (
g_nemesis[victim]) // fire duration (nemesis takes less)
            
params[0] = get_pcvar_num(cvar_fireduration)
        else
            
params[0] = get_pcvar_num(cvar_fireduration)*2
        
        
// Set burning task on victim
        
set_task(0.1"burning_flame"victim+TASK_BLOODparamssizeof params)
    }
    
    
// Get rid of the grenade
    
engfunc(EngFunc_RemoveEntityent)

TecnoZP is offline
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-13-2012 , 14:29   Re: [ZP] Problema con granada de aniquilación
#8

Prueba
PHP Code:
public aniquilacion_explode(ent)
 {
        
// Toma el origen de la greanda
        
static Float:originF[3]
        
pev(entpev_originoriginF)
        
        
// Este es el efecto de la explosion (color de la onda expansiva , esa tipo de onda expansiba
        // recomiendo no modificarla
        
create_blast2(originF)
        
        
// Este es el sonido de la explosion
        
engfunc(EngFunc_EmitSoundentCHAN_WEAPONgrenade_fire[random_num(0sizeof grenade_fire 1)], 1.0ATTN_NORM0PITCH_NORM)
        
        
// Esto  son la varaibles para despues detectar a la victima
        
static victim
        victim 
= -1
        
        
// Esto se activara si la victima esta en el radio indicado en la constante
        
while ((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFNADE_EXPLOSION_RADIUS)) != 0)
        {
            
// Aca es para ponerle condiciones , es decir, que este vivo, que no sea zombie y demas
            
if (is_user_alive(victim) || !g_zombie[victim])
            {
                
                
// Aca esta el dmg este tipo de dmg es para que valla bajando de apoco la vida pero de apoco
                 
message_begin(MSG_ONE_UNRELIABLEg_msgDamage_victim)
                
write_byte(0// damage save
                
write_byte(0// damage take
                
write_long(DMG_BURN// damage type
                
write_coord(0// x
                
write_coord(0// y
                
write_coord(0// z
                
message_end()
                                
            }
            
            
// Esto remueve la entidad
            
engfunc(EngFunc_RemoveEntityent)
        }
        
        
// Our task params
        
static params[1]
        
        if (
g_nemesis[victim]) // fire duration (nemesis takes less)
            
params[0] = get_pcvar_num(cvar_fireduration)
        else
            
params[0] = get_pcvar_num(cvar_fireduration)*2
        
        
// Set burning task on victim
        
set_task(0.1"burning_flame"victim+TASK_BLOODparamssizeof params)
    }
    
    
// Get rid of the grenade
    
engfunc(EngFunc_RemoveEntityent)

__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
TecnoZP
BANNED
Join Date: Jun 2012
Location: Buenos Aires, Argentina
Old 08-13-2012 , 14:42   Re: [ZP] Problema con granada de aniquilación
#9

Con eso me tira 26 errores
TecnoZP is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 08-13-2012 , 21:28   Re: [ZP] Problema con granada de aniquilación
#10

no cerraste un } posiblemente
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
 


Thread Tools
Display Modes

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 02:20.


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