Raised This Month: $ Target: $400
 0% 

[Tutorial] First lesson in a series develop [ZPA 1.61] - Add Explosive Bomb.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 12-09-2015 , 09:55   [Tutorial] First lesson in a series develop [ZPA 1.61] - Add Explosive Bomb.
Reply With Quote #1

First Lesson Add (Explosive Bomb)
- all rights reserved to arvEL.-, in : 9/12/2015
In these lesson i will explain how to develop [Zombie Plague Advance v1.6.1]
delete the flare bomb and add explosive bomb.

first go to this topic [ # ] and download
[ZPA 1.6.1]
after that open the file [zombie_plague_advance_v1-6-1.sma] in [notepad++]

first add this variables

PHP Code:
#define HE_RANGE(%1,%2) entity_range(%1,%2)
#define HE_MODEL_EXPLODE    "sprites/zerogxplode.spr"
#define HE_SOUND_EXPLODE    "fvox/flatline.wav" 
after that. press [Ctrl + F] and write.

PHP Code:
// grenade sprites 
it's have codes:

PHP Code:
new g_trailSprg_exploSprg_flameSprg_smokeSprg_glassSpr // grenade sprites 
replace all codes to:

PHP Code:
new g_trailSprg_exploSprg_flameSprg_smokeSprg_glassSprg_hExplode // grenade sprites 

after that. press [Ctrl + F] and write.

[PHP]// Custom sprites for grenades[/PHP

]it's have codes:

PHP Code:
    // Custom sprites for grenades
    
g_trailSpr engfunc(EngFunc_PrecacheModelsprite_grenade_trail)
    
g_exploSpr engfunc(EngFunc_PrecacheModelsprite_grenade_ring)
    
g_flameSpr engfunc(EngFunc_PrecacheModelsprite_grenade_fire)
    
g_smokeSpr engfunc(EngFunc_PrecacheModelsprite_grenade_smoke)
    
g_glassSpr engfunc(EngFunc_PrecacheModelsprite_grenade_glass
replace all codes to:

PHP Code:
g_trailSpr engfunc(EngFunc_PrecacheModel"sprites/laserbeam.spr")
g_exploSpr engfunc(EngFunc_PrecacheModel"sprites/shockwave.spr")
g_flameSpr engfunc(EngFunc_PrecacheModel"sprites/flame.spr")
g_smokeSpr engfunc(EngFunc_PrecacheModel"sprites/black_smoke3.spr")
g_glassSpr engfunc(EngFunc_PrecacheModel"models/glassgibs.mdl")
g_hExplode engfuncEngFunc_PrecacheModel"sprites/zerogxplode.spr" ); 

after that. press [Ctrl + F] and write.

PHP Code:
// HACK: pev_ field used to store custom nade types and their values 
it's have have this codes:

PHP Code:
// HACK: pev_ field used to store custom nade types and their values
const PEV_NADE_TYPE pev_flTimeStepSound
const NADE_TYPE_INFECTION 1111
const NADE_TYPE_NAPALM 2222
const NADE_TYPE_FROST 3333
const NADE_TYPE_FLARE 4444
const PEV_FLARE_COLOR pev_punchangle
const PEV_FLARE_DURATION pev_flSwimTime 
replace all this codes to:

PHP Code:
const PEV_NADE_TYPE pev_flTimeStepSound
const NADE_TYPE_INFECTION 1111
const NADE_TYPE_EXPLODE 2222
const NADE_TYPE_FROST 3333
const NADE_TYPE_NAPALM 4444
const PEV_FLARE_COLOR pev_punchangle
const PEV_FLARE_DURATION pev_flSwimTime 
after that.
press [Ctrl + F] and write.

PHP Code:
// Check if it's one of our custom nades 
it's have this codes:

PHP Code:
// 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_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)
            }
        }
    } 
replace all this codes to:

PHP Code:
    // 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_EXPLODE// HE Grenade
        
{
        
he_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;
        }
    } 

after that. press [Ctrl + F] and write.

PHP Code:
// Fire Grenade Explosion 
it's have codes

PHP Code:
// Fire Grenade Explosion
fire_explode(ent)
{
    
// Get origin
    
static Float:originF[3]
    
pev(entpev_originoriginF)
    
    
// Make the explosion
    
create_blast2(originF)
    
    
// Fire nade explode sound
    
static sound[64]
    
ArrayGetString(grenade_firerandom_num(0ArraySize(grenade_fire) - 1), soundcharsmax(sound))
    
emit_sound(entCHAN_WEAPONsound1.0ATTN_NORM0PITCH_NORM)
    
    
// Collisions
    
static victim
    victim 
= -1
    
    
while ((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFNADE_EXPLOSION_RADIUS)) != 0)
    {
        
// Only effect alive zombies
        
if (!is_user_valid_alive(victim) || !g_zombie[victim] || g_nodamage[victim])
            continue;
        
        
// Heat icon?
        
if (get_pcvar_num(cvar_hudicons))
        {
            
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()
        }
        
        if (
g_nemesis[victim] || g_assassin[victim]) // fire duration (nemesis/assassin is fire resistant)
            
g_burning_duration[victim] += get_pcvar_num(cvar_fireduration)
        else
            
g_burning_duration[victim] += get_pcvar_num(cvar_fireduration) * 5
        
        
// Set burning task on victim if not present
        
if (!task_exists(victim+TASK_BURN))
            
set_task(0.2"burning_flame"victim+TASK_BURN__"b")
    }
    
    
// Get rid of the grenade
    
engfunc(EngFunc_RemoveEntityent)
}

// HE Grenade Explosion
he_explode(ent)
{
    static 
FloatoriginF]
    
peventpev_originoriginF );
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_EXPLOSION );
    
engfuncEngFunc_WriteCoordoriginF] );
    
engfuncEngFunc_WriteCoordoriginF] );
    
engfuncEngFunc_WriteCoordoriginF] );
    
write_shortg_hExplode );
    
write_byte30 ); //marime
    
write_byte15 ); //viteza
    
write_byte);
    
message_end( );

    static 
attacker
    attacker 
pev(entpev_owner)

    for( new 
victim 1victim 33victim++ )
    {
    if( !
is_user_connectedvictim ) || !is_user_alivevictim ) ) continue;
    if( 
g_zombie[victim] )
    {
    static 
FloatfDistanceFloatfDamage;

    
fDistance HE_RANGEvictiment );
    if( 
fDistance 300.0 )
    {
    
fDamage 667.0 fDistance;
    
message_beginMSG_ONE_UNRELIABLEget_user_msgid"ScreenFade" ), _victim );
    
write_short2048 );
    
write_short1024 );
    
write_shortFFADE_IN );
    
write_byte220 );
    
write_byte);
    
write_byte);
    
write_bytefDistance 220 220 205 );
    
message_end( );

    
message_beginMSG_ONE_UNRELIABLEg_msgScreenShake_victim );
    
write_short4096 100 ); // amplitude
    
write_short4096 500 ); // duration
    
write_short4096 200 ); // frequency
    
message_end( );

    if( 
floatget_user_healthvictim ) ) - fDamage 0.0 )
    { 
     
ExecuteHamBHam_TakeDamagevictimentattackerfDamageDMG_BLAST );
    }
    else
    {
    
ExecuteHamBHam_Killedvictimattacker);
    }

    if( !
g_nemesis[victim] && !g_assassin[victim] )
    
fDamage *= 0.75;

    static 
name[32]; get_user_name(victimnamecharsmax(name))
    
zp_colored_print(attacker"^4[ZP]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage"namefDamage)
        
    if (
fDamage >= get_pcvar_num(cvar_ammodamage))
        
g_ammopacks[attacker] += 2
    
else
        
g_ammopacks[attacker] += 1

    
}
    }
    }

    
engfunc(EngFunc_RemoveEntityent)

replace all codes with:

PHP Code:
// Fire Grenade Explosion
fire_explode(ent)
{
    
// Get origin
    
static Float:originF[3]
    
pev(entpev_originoriginF)
    
    
// Make the explosion
    
create_blast2(originF)
    
    
// Fire nade explode sound
    
static sound[64]
    
ArrayGetString(grenade_firerandom_num(0ArraySize(grenade_fire) - 1), soundcharsmax(sound))
    
emit_sound(entCHAN_WEAPONsound1.0ATTN_NORM0PITCH_NORM)
    
    
// Collisions
    
static victim
    victim 
= -1
    
    
while ((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFNADE_EXPLOSION_RADIUS)) != 0)
    {
        
// Only effect alive zombies
        
if (!is_user_valid_alive(victim) || !g_zombie[victim] || g_nodamage[victim])
            continue;
        
        
// Heat icon?
        
if (get_pcvar_num(cvar_hudicons))
        {
            
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()
        }
        
        if (
g_nemesis[victim] || g_assassin[victim]) // fire duration (nemesis/assassin is fire resistant)
            
g_burning_duration[victim] += get_pcvar_num(cvar_fireduration)
        else
            
g_burning_duration[victim] += get_pcvar_num(cvar_fireduration) * 5
        
        
// Set burning task on victim if not present
        
if (!task_exists(victim+TASK_BURN))
            
set_task(0.2"burning_flame"victim+TASK_BURN__"b")
    }
    
    
// Get rid of the grenade
    
engfunc(EngFunc_RemoveEntityent)
}

// HE Grenade Explosion
he_explode(ent)
{
    static 
FloatoriginF]
    
peventpev_originoriginF );
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_EXPLOSION );
    
engfuncEngFunc_WriteCoordoriginF] );
    
engfuncEngFunc_WriteCoordoriginF] );
    
engfuncEngFunc_WriteCoordoriginF] );
    
write_shortg_hExplode );
    
write_byte30 ); //marime
    
write_byte15 ); //viteza
    
write_byte);
    
message_end( );

    static 
attacker
    attacker 
pev(entpev_owner)

    for( new 
victim 1victim 33victim++ )
    {
    if( !
is_user_connectedvictim ) || !is_user_alivevictim ) ) continue;
    if( 
g_zombie[victim] )
    {
    static 
FloatfDistanceFloatfDamage;

    
fDistance HattrickRangevictiment );
    if( 
fDistance 300.0 )
    {
    
fDamage 667.0 fDistance;
    
message_beginMSG_ONE_UNRELIABLEget_user_msgid"ScreenFade" ), _victim );
    
write_short2048 );
    
write_short1024 );
    
write_shortFFADE_IN );
    
write_byte220 );
    
write_byte);
    
write_byte);
    
write_bytefDistance 220 220 205 );
    
message_end( );

    
message_beginMSG_ONE_UNRELIABLEg_msgScreenShake_victim );
    
write_short4096 100 ); // amplitude
    
write_short4096 500 ); // duration
    
write_short4096 200 ); // frequency
    
message_end( );

    if( 
floatget_user_healthvictim ) ) - fDamage 0.0 )
    { 
     
ExecuteHamBHam_TakeDamagevictimentattackerfDamageDMG_BLAST );
    }
    else
    {
    
ExecuteHamBHam_Killedvictimattacker);
    }

    if( !
g_nemesis[victim] && !g_assassin[victim] )
    
fDamage *= 0.75;

    static 
name[32]; get_user_name(victimnamecharsmax(name))
    
zp_colored_print(attacker"^4[ZP]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage"namefDamage)
        
    if (
fDamage >= get_pcvar_num(cvar_ammodamage))
        
g_ammopacks[attacker] += 2
    
else
        
g_ammopacks[attacker] += 1

    
}
    }
    }

    
engfunc(EngFunc_RemoveEntityent)


after that. press [Ctrl + F] and write.

PHP Code:
// Forward Set Model 

it's have codes:

PHP Code:
// Forward Set Model
public fw_SetModel(entity, const model[])
{
    
// We don't care
    
if (strlen(model) < 8)
        return;
    
    
// 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;
        }
    }
    
    
// Narrow down our matches a bit
    
if (model[7] != 'w' || model[8] != '_')
        return;
    
    
// Get damage time of grenade
    
static Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    
    
// Grenade not yet thrown
    
if (dmgtime == 0.0)
        return;
    
    
// 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)
    }

replace all codes to:

PHP Code:
// Forward Set Model
public fw_SetModel(entity, const model[])
{
    
// We don't care
    
if (strlen(model) < 8)
        return;
    
    
// 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;
        }
    }
    
    
// Narrow down our matches a bit
    
if (model[7] != 'w' || model[8] != '_')
        return;
    
    
// Get damage time of grenade
    
static Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    
    
// Grenade not yet thrown
    
if (dmgtime == 0.0)
        return;
    
    
// 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
{

// 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
{

// 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_EXPLODE)
}
else if (
model[9] == 'f' && model[10] == 'l' && get_pcvar_num(cvar_frostgrenades)) // Frost Grenade
{

// 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(250// r
write_byte(100// 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] == 's' && model[10] == 'm' && get_pcvar_num(cvar_flaregrenades)) // Flare
{

// 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)
}

after that. press [Ctrl + F] and write.

PHP Code:
// Infection Bomb: Blast 
it's have this codes:

PHP Code:
// Infection Bomb: Blast
create_blast(const Float:originF[3])
{
    
// Smallest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+385.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(0// red
    
write_byte(250// green
    
write_byte(0// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Medium ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+470.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(0// red
    
write_byte(250// green
    
write_byte(0// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Largest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+555.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(0// red
    
write_byte(250// green
    
write_byte(0// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
}

// Fire Grenade: Fire Blast
create_blast2(const Float:originF[3])
{
    
// Smallest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+385.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(200// red
    
write_byte(100// green
    
write_byte(0// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Medium ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+470.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(200// red
    
write_byte(50// green
    
write_byte(0// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Largest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+555.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(200// red
    
write_byte(0// green
    
write_byte(0// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
}

// Frost Grenade: Freeze Blast
create_blast3(const Float:originF[3])
{
    
// Smallest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+385.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(0// red
    
write_byte(100// green
    
write_byte(200// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Medium ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+470.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(0// red
    
write_byte(100// green
    
write_byte(200// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Largest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+555.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(0// red
    
write_byte(100// green
    
write_byte(200// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()

replac all codes to:

PHP Code:
// Infection Bomb: Blast
create_blast(const Float:originF[3])
{
    
    
// Medium ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+470.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(0// red
    
write_byte(250// green
    
write_byte(0// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()

}

// Fire Grenade: Fire Blast
create_blast2(const Float:originF[3])
{
    
    
// Medium ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+470.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(200// red
    
write_byte(50// green
    
write_byte(0// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
}

// Frost Grenade: Freeze Blast
create_blast3(const Float:originF[3])
{

    
    
// Medium ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+470.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(0// red
    
write_byte(100// green
    
write_byte(200// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    


after that. press [Ctrl + F] and write.

PHP Code:
// Flare Lighting Effects 
it's have this codes:

PHP Code:
// Flare Lighting Effects
flare_lighting(entityduration)
{
    
// Get origin and color
    
static Float:originF[3], color[3]
    
pev(entitypev_originoriginF)
    
pev(entityPEV_FLARE_COLORcolor)
    
    if (
g_assassinround)
    {    
        
// Lighting in assassin round is different
        
engfunc(EngFunc_MessageBeginMSG_PASSVC_TEMPENTITYoriginF0)
        
write_byte(TE_DLIGHT// TE id
        
engfunc(EngFunc_WriteCoordoriginF[0]) // x
        
engfunc(EngFunc_WriteCoordoriginF[1]) // y
        
engfunc(EngFunc_WriteCoordoriginF[2]) // z
        
write_byte(get_pcvar_num(cvar_flaresize2)) // radius
        
write_byte(color[0]) // r
        
write_byte(color[1]) // g
        
write_byte(color[2]) // b
        
write_byte(51//life
        
write_byte((duration 2) ? 0//decay rate
        
message_end()
    }
    else
    {
        
// Lighting
        
engfunc(EngFunc_MessageBeginMSG_PASSVC_TEMPENTITYoriginF0)
        
write_byte(TE_DLIGHT// TE id
        
engfunc(EngFunc_WriteCoordoriginF[0]) // x
        
engfunc(EngFunc_WriteCoordoriginF[1]) // y
        
engfunc(EngFunc_WriteCoordoriginF[2]) // z
        
write_byte(get_pcvar_num(cvar_flaresize)) // radius
        
write_byte(color[0]) // r
        
write_byte(color[1]) // g
        
write_byte(color[2]) // b
        
write_byte(51//life
        
write_byte((duration 2) ? 0//decay rate
        
message_end()
    }
    
    
// Sparks
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_SPARKS// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
message_end()

now just. delete all this codes
now search about this
variables and delete it

PHP Code:
cvar_flarecolor
cvar_flareduration
cvar_flaresize
cvar_flaresize2 

after that. press [Ctrl + F] and write.

PHP Code:
// CVARS - Custom Grenades 
it's have this codes:

PHP Code:
    // CVARS - Custom Grenades
    
cvar_firegrenades register_cvar("zp_fire_grenades""1")
    
cvar_fireduration register_cvar("zp_fire_duration""10")
    
cvar_firedamage register_cvar("zp_fire_damage""5")
    
cvar_fireslowdown register_cvar("zp_fire_slowdown""0.5")
    
cvar_frostgrenades register_cvar("zp_frost_grenades""1")
    
cvar_freezeduration register_cvar("zp_frost_duration""3")
    
cvar_frozenhit register_cvar("zp_frost_hit""1")
    
cvar_flaregrenades register_cvar("zp_flare_grenades","1")
    
cvar_flareduration register_cvar("zp_flare_duration""60")
    
cvar_flaresize register_cvar("zp_flare_size""25")
    
cvar_flarecolor register_cvar("zp_flare_color""5")
    
cvar_flaresize2 register_cvar("zp_flare_size_assassin""15"
replace all codes to:

PHP Code:
    // CVARS - Custom Grenades
    
cvar_firegrenades register_cvar("zp_fire_grenades""1")
    
cvar_fireduration register_cvar("zp_fire_duration""10")
    
cvar_firedamage register_cvar("zp_fire_damage""5")
    
cvar_fireslowdown register_cvar("zp_fire_slowdown""0.5")
    
cvar_frostgrenades register_cvar("zp_frost_grenades""1")
    
cvar_freezeduration register_cvar("zp_frost_duration""3")
    
cvar_frozenhit register_cvar("zp_frost_hit""1")
    
cvar_flaregrenades register_cvar("zp_flare_grenades","1"
now make compile and ejnoy

all rights reserved to arvEL.-
__________________

Last edited by arvEL.; 10-07-2016 at 11:18.
arvEL. is offline
Send a message via Skype™ to arvEL.
 



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 23:16.


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