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

[ES][ZP] Campo de Fuerza(SOLUCIONADO)


  
 
 
Thread Tools Display Modes
Author Message
Axelromero91
Member
Join Date: Jun 2013
Location: Buenos Aires, Argentina
Old 09-29-2013 , 20:38   [ES][ZP] Campo de Fuerza(SOLUCIONADO)
#1

Bueno, creo que ya postee tres thread pidiendo ayuda y dentro de poco me van a matar si sigo asi.

Bueno sin más preámbulos, yo agregue el campo de fuerza de el tutorial que hizo lucas:

Agregar campo de fuerza: http://forums.alliedmods.net/showthread.php?t=126352

y tengo el problema de que cuando tiro la bomba, no me muestra el model w_ de la granada en el piso, osea queda el model por default osea el de la flare. Lei algunos thread en los que decia que pasando las funciones a fakemeta el error desaparecia, pero la cosa es que no se como pasarlo a fakemeta. asique hice este tread para ver si me pueden ayudar a solucionarlo.

Last edited by Axelromero91; 10-02-2013 at 11:14.
Axelromero91 is offline
Send a message via MSN to Axelromero91
KermesS
Senior Member
Join Date: Jan 2013
Location: Amsterdam
Old 09-30-2013 , 09:13   Re: [ES][ZP] Campo de Fuerza
#2

Es porque ya hay un tema por eso en el zp default, en el cual habia que arreglar unas cosillas antes de poder agregar model w_ a las granadas flare, fire y frost y como soy un tipo de buena leche te voy a dejar mi función en la cual ya esta todo resuelto, lo que tenes que hacer con esta misma es reemplazarla por la de tu zp y agregarle lo de la granada bubble tal y como lo hiciste anteriormente:

PHP Code:
// Forward Set Model
public fw_SetModel(entity, const model[])
{
    
// We don't care
    
if (strlen(model) < 8)
        return 
FMRES_IGNORED;
    
    
// Remove weapons?
    
if (get_pcvar_float(cvar_removedropped) > 0.0)
    {
        
// Get entity's classname
        
static classname[10]
        
pev(entitypev_classnameclassnamecharsmax(classname))
        
        
// Check if it's a weapon box
        
if (equal(classname"weaponbox"))
        {
            
// They get automatically removed when thinking
            
set_pev(entitypev_nextthinkget_gametime() + get_pcvar_float(cvar_removedropped))
            return 
FMRES_IGNORED;
        }
    }
    
    
// Narrow down our matches a bit
    
if (model[7] != 'w' || model[8] != '_')
        return 
FMRES_IGNORED;
    
    
// Get damage time of grenade
    
static Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    
    
// Grenade not yet thrown
    
if (dmgtime == 0.0)
        return 
FMRES_IGNORED;
    
    
// Get whether grenade's owner is a zombie
    
if (g_zombie[pev(entitypev_owner)])
    {
        if (
model[9] == 'h' && model[10] == 'e' && get_pcvar_num(cvar_extrainfbomb)) // Infection Bomb
        
{
            
// Give it a glow
            
fm_set_rendering(entitykRenderFxGlowShell02500kRenderNormal16);
            
            
// 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(250// 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_INFECTION)
        }
    }
    else if (
model[9] == 'h' && model[10] == 'e' && get_pcvar_num(cvar_firegrenades)) // Napalm Grenade
    
{
        
// 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)
    }
    else if (
model[9] == 'f' && model[10] == 'l' && get_pcvar_num(cvar_frostgrenades)) // Frost Grenade
    
{
        
// Give it a glow
        
fm_set_rendering(entitykRenderFxGlowShell0100200kRenderNormal16);
        
        
// 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(100// g
        
write_byte(200// b
        
write_byte(200// brightness
        
message_end()
        
        
// Set grenade type on the thrown grenade entity
        
set_pev(entityPEV_NADE_TYPENADE_TYPE_FROST)
    }
    else if (
model[9] == 's' && model[10] == 'm' && get_pcvar_num(cvar_flaregrenades)) // Flare
    
{
        
// Build flare's color
        
static rgb[3]
        switch (
get_pcvar_num(cvar_flarecolor))
        {
            case 
0// white
            
{
                
rgb[0] = 255 // r
                
rgb[1] = 255 // g
                
rgb[2] = 255 // b
            
}
            case 
1// red
            
{
                
rgb[0] = random_num(50,255// r
                
rgb[1] = // g
                
rgb[2] = // b
            
}
            case 
2// green
            
{
                
rgb[0] = // r
                
rgb[1] = random_num(50,255// g
                
rgb[2] = // b
            
}
            case 
3// blue
            
{
                
rgb[0] = // r
                
rgb[1] = // g
                
rgb[2] = random_num(50,255// b
            
}
            case 
4// random (all colors)
            
{
                
rgb[0] = random_num(50,200// r
                
rgb[1] = random_num(50,200// g
                
rgb[2] = random_num(50,200// b
            
}
            case 
5// random (r,g,b)
            
{
                switch (
random_num(16))
                {
                    case 
1// red
                    
{
                        
rgb[0] = 250 // r
                        
rgb[1] = // g
                        
rgb[2] = // b
                    
}
                    case 
2// green
                    
{
                        
rgb[0] = // r
                        
rgb[1] = 250 // g
                        
rgb[2] = // b
                    
}
                    case 
3// blue
                    
{
                        
rgb[0] = // r
                        
rgb[1] = // g
                        
rgb[2] = 250 // b
                    
}
                    case 
4// cyan
                    
{
                        
rgb[0] = // r
                        
rgb[1] = 250 // g
                        
rgb[2] = 250 // b
                    
}
                    case 
5// pink
                    
{
                        
rgb[0] = 250 // r
                        
rgb[1] = // g
                        
rgb[2] = 250 // b
                    
}
                    case 
6// yellow
                    
{
                        
rgb[0] = 250 // r
                        
rgb[1] = 250 // g
                        
rgb[2] = // b
                    
}
                }
            }
        }
        
        
// Give it a glow
        
fm_set_rendering(entitykRenderFxGlowShellrgb[0], rgb[1], rgb[2], kRenderNormal16);
        
        
// 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(rgb[0]) // r
        
write_byte(rgb[1]) // g
        
write_byte(rgb[2]) // b
        
write_byte(200// brightness
        
message_end()
        
        
// Set grenade type on the thrown grenade entity
        
set_pev(entityPEV_NADE_TYPENADE_TYPE_FLARE)
        
        
// Set flare color on the thrown grenade entity
        
set_pev(entityPEV_FLARE_COLORrgb)
    }
    return 
FMRES_SUPERCEDE;

Espero haberte ayudado.
__________________
KermesS is offline
Axelromero91
Member
Join Date: Jun 2013
Location: Buenos Aires, Argentina
Old 09-30-2013 , 12:29   Re: [ES][ZP] Campo de Fuerza
#3

Tengo Zp 4.2 este es mi fw_setmodel:

PHP Code:
public fw_SetModel(entity, const model[])
{
    
// Get remove dropped weapons setting
    
static Float:removeweapons
    removeweapons 
get_pcvar_float(cvar_removedropped)
    
    
// Remove weapons?
    
if (removeweapons 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() + removeweapons)
            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(entitykRenderFxGlowShell02000kRenderNormal16);
            
            
// 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(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_INFECTION)
        }
        else if (
get_pcvar_num(cvar_firegrenades)) // [HUMAN] - Fire Grenade
        
{
            
// 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)
        }
    }
    else if (
equal(model[7], "w_fl"4) && get_pcvar_num(cvar_frostgrenades)) // Frost Grenade
    
{
        
// Give it a glow
        
fm_set_rendering(entitykRenderFxGlowShell0100200kRenderNormal16);
        
        
// 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(100// g
        
write_byte(200// b
        
write_byte(200// brightness
        
message_end()
        
        
// Set grenade type on the thrown grenade entity
        
set_pev(entityPEV_NADE_TYPENADE_TYPE_FROST)
    }
    else if (
equal(model[7], "w_sm"4) && get_pcvar_num(cvar_flaregrenades)) // Flare
    
{
        if(!
g_zombie[pev(entitypev_owner)] && g_bubble_bomb[pev(entitypev_owner)]) 
        {
            
fm_set_rendering(entitykRenderFxGlowShell255255255kRenderNormal16
            
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
write_byte(TE_BEAMFOLLOW
            
write_short(entity
            
write_short(g_trailSpr
            
write_byte(10
            
write_byte(10
            
write_byte(255
            
write_byte(255
            
write_byte(255
            
write_byte(500)
            
message_end()
            
            
            
set_pev(entitypev_flTimeStepSoundNADE_TYPE_CAMPO// tipo de bomba ( NADE_TYPE_CAMPO )
            
            
entity_set_model(entityw_campo// aca seteo el model, el cual no me está funcionando.
        
}
        else
        {
            
// Make the flare color
            
static rgb[3]
            switch (
get_pcvar_num(cvar_flarecolor))
            {
                case 
0// white
                
{
                    
rgb[0] = 255 // r
                    
rgb[1] = 255 // g
                    
rgb[2] = 255 // b
                
}
                case 
1// red
                
{
                    
rgb[0] = random_num(50,255// r
                    
rgb[1] = // g
                    
rgb[2] = // b
                
}
                case 
2// green
                
{
                    
rgb[0] = // r
                    
rgb[1] = random_num(50,255// g
                    
rgb[2] = // b
                
}
                case 
3// blue
                
{
                    
rgb[0] = // r
                    
rgb[1] = // g
                    
rgb[2] = random_num(50,255// b
                
}
                case 
4// random (all colors)
                
{
                    
rgb[0] = random_num(50,200// r
                    
rgb[1] = random_num(50,200// g
                    
rgb[2] = random_num(50,200// b
                
}
                case 
5// random (r,g,b)
                
{
                    switch (
random_num(13))
                    {
                        case 
1// red
                        
{
                            
rgb[0] = random_num(50,255// r
                            
rgb[1] = // g
                            
rgb[2] = // b
                        
}
                        case 
2// green
                        
{
                            
rgb[0] = // r
                            
rgb[1] = random_num(50,255// g
                            
rgb[2] = // b
                        
}
                        case 
3// blue
                        
{
                            
rgb[0] = // r
                            
rgb[1] = // g
                            
rgb[2] = random_num(50,255// b
                        
}
                    }
                }
            }
            
            
// Give it a glow
            
fm_set_rendering(entitykRenderFxGlowShellrgb[0], rgb[1], rgb[2], kRenderNormal16);
            
            
// 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(rgb[0]) // r
            
write_byte(rgb[1]) // g
            
write_byte(rgb[2]) // b
            
write_byte(200// brightness
            
message_end()
            
            
// Set grenade type on the thrown grenade entity
            
set_pev(entityPEV_NADE_TYPENADE_TYPE_FLARE)
            
            
// Set flare color on the thrown grenade entity
            
set_pev(entityPEV_FLARE_COLORrgb)
        }
    }

Intente poniendo
PHP Code:
return FMRES_SUPERCEDE
, pero me tira error al compilar.

Last edited by Axelromero91; 09-30-2013 at 22:24.
Axelromero91 is offline
Send a message via MSN to Axelromero91
 


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 05:03.


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