View Single Post
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 04-25-2019 , 06:30   Re: Biohazard v2.00 Beta 3b (Zombie Mod)
Reply With Quote #4072

https://forums.alliedmods.net/showthread.php?t=215468

Dasher zombie for biohazard mod.

I set that every zombie has this ability( because I do not use classes but zombie evolution).

If somebody needs for particular class,maybe we can adjust it.

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta_util>
#include <biohazard>

new bool:g_cooldown[33], g_rushing[33], cvar_rush

public plugin_precache()
{
    
register_plugin("[BIO] Class: Rusher Zombie""1.0""Catastrophe")
        
register_clcmd("drop","do_rush")
          
        
cvar_rush register_cvar("rush_cooldown","20.0")      
}

public 
do_rush(ent)
{
    if(!
is_user_alive(ent) || g_cooldown[ent] || !is_user_zombie(ent))
        return

        if(!(
pev(entpev_flags) & FL_ONGROUND))    
                return

        
g_cooldown[ent] = true
        g_rushing
[ent] = true

    set_task
(0.1"rush_now"ent)
        
        
set_task(get_pcvar_float(cvar_rush),"reset_cooldown",ent)
        
set_task(1.0,"resetmd",ent
}

public 
rush_now(ent)
{    
    if(!
is_user_alive(ent))
        return
    
    static 
Float:Origin[3]
    
get_position(ent1000.00.00.0Origin)
    
    
hook_ent2(entOrigin2000.0)
}

public 
reset_cooldown(id)
{
       
g_cooldown[id] = false
}

public 
resetmd(id)
{
       
g_rushing[id] = false      
}

stock get_position(entFloat:forwFloat:rightFloat:upFloat:vStart[])
{
    new 
Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3]
    
    
pev(entpev_originvOrigin)
    
pev(entpev_view_ofs,vUp//for player
    
xs_vec_add(vOrigin,vUp,vOrigin)
    
pev(entpev_v_anglevAngle// if normal entity ,use pev_angles
    
    
vAngle[0] = 0.0
    
    angle_vector
(vAngle,ANGLEVECTOR_FORWARD,vForward//or use EngFunc_AngleVectors
    
angle_vector(vAngle,ANGLEVECTOR_RIGHT,vRight)
    
angle_vector(vAngle,ANGLEVECTOR_UP,vUp)
    
    
vStart[0] = vOrigin[0] + vForward[0] * forw vRight[0] * right vUp[0] * up
    vStart
[1] = vOrigin[1] + vForward[1] * forw vRight[1] * right vUp[1] * up
    vStart
[2] = vOrigin[2] + vForward[2] * forw vRight[2] * right vUp[2] * up
}

stock hook_ent2(entFloat:VicOrigin[3], Float:speed)
{
    static 
Float:fl_Velocity[3]
    static 
Float:EntOrigin[3]
    
    
pev(entpev_originEntOrigin)
    
    static 
Float:distance_f
    distance_f 
get_distance_f(EntOriginVicOrigin)
    
    if (
distance_f 60.0)
    {
        new 
Float:fl_Time distance_f speed
        
        fl_Velocity
[0] = (VicOrigin[0] - EntOrigin[0]) / fl_Time
        fl_Velocity
[1] = (VicOrigin[1] - EntOrigin[1]) / fl_Time
        fl_Velocity
[2] = (VicOrigin[2] - EntOrigin[2]) / fl_Time
    
} else {
        
fl_Velocity[0] = 0.0
        fl_Velocity
[1] = 0.0
        fl_Velocity
[2] = 0.0
    
}

    
entity_set_vector(entEV_VEC_velocityfl_Velocity)

https://forums.alliedmods.net/showthread.php?t=150283

Houndeye Zombie for Biohazard mod.

I set that every zombie has this ability( because I do not use classes but zombie evolution).

If somebody needs for particular class,maybe we can adjust it.

PHP Code:
/*                Houndeye Zombie v0.4
                    By Morte
                    
    -. Description: Blast player and make it fly.
    
    -. Cvars: zp_houndeye_timeblast 2.5 (Time to Blast)
          zp_houndeye_radius 150.0 (Blast Radius)
          zp_houndeye_infect_blast 0 (Blast infect players)
          zp_houndeye_damage 0 (Blast Damage)
          zp_houndeye_damage_amount 25 (Blast Damage Amount)
          
          
    -. Changelog:
            # 0.1 - Plugin Release
            # 0.2 - Added 2 cvar's: 1) To activate the blast damage
                            2) To select the amount of the damage
            # 0.3 - Now you can't use blast hability if you are nemesis.
            # 0.4 - Fixed cvar "zp_houndeye_damage_amount".
    -. Credits:
            # shinoda - Help me with how to make players fly.
            # MeRcyLeZZ - For his Zombie Plague ^.^
            # frk_14 - For the model.

*/

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <xs>
#include <engine>
#include <biohazard>

/*================================================================================
 [Plugin Customization]
=================================================================================*/
new const beam_cylinder[] = "sprites/white.spr"

new const houndeye_attack[][] = { "houndeye/he_attack1.wav""houndeye/he_attack3.wav" }
new const 
houndeye_blast[][] = { "houndeye/he_blast1.wav""houndeye/he_blast3.wav" }

/*================================================================================
 [End Customization]
=================================================================================*/

#define is_player(%0)    (1 <= %0 <= giMaxplayers)
#define TASK_BARTIME 16000

// Zombie vars
new gMsgBarTimegMsgDeathMsggSprBeamgiMaxplayerscvar_timeblastcvar_radiuscvar_blast_infect,
cvar_damagecvar_damage_amount

public plugin_init()
{
    
register_plugin("Houndeye Zombie""0.4""Morte")
    
    
cvar_timeblast register_cvar("zp_houndeye_timeblast""2.5")
    
cvar_radius register_cvar("zp_houndeye_radius""150.0")
    
cvar_blast_infect register_cvar("zp_houndeye_infect""0")
    
cvar_damage register_cvar("zp_houndeye_damage""0")
    
cvar_damage_amount register_cvar("zp_houndeye_damage_amount""25")
    
    
register_forwardFM_CmdStart"CmdStart")
    
    
giMaxplayers get_maxplayers()
    
gMsgBarTime get_user_msgid("BarTime")
    
gMsgDeathMsg get_user_msgid("DeathMsg")
}

public 
plugin_precache()

    
gSprBeam precache_model(beam_cylinder)
    
    for (new 
0sizeof houndeye_attacki++)
        
engfunc(EngFunc_PrecacheSoundhoundeye_attack[i])
    for (new 
0sizeof houndeye_blasti++)
        
engfunc(EngFunc_PrecacheSoundhoundeye_blast[i])
}

public 
CmdStart(id)
{
    if(!
is_user_alive(id))
        return;
    
    static 
iButtoniButton pev(idpev_button)
    static 
iOldButtoniOldButton pev(idpev_oldbuttons)
    
    if(
is_user_zombie(id))
    {
        if( ( 
iButton IN_USE ) && !( iOldButton IN_USE ) )
        {
            if(!
is_user_alive(id))
                return;

            
message_begin(MSG_ONEgMsgBarTime_id)
            
write_byte(get_pcvar_num(cvar_timeblast))
            
write_byte(0)
            
message_end()
            
            
emit_sound(idCHAN_VOICEhoundeye_attack[random_num(0sizeof houndeye_attack 1)], 1.0ATTN_NORM0PITCH_NORM)
            
            
set_task(get_pcvar_float(cvar_timeblast), "blast_players"id+TASK_BARTIME)
        }
            
        if( 
iOldButton IN_USE && !( iButton IN_USE ) )
            
set_task(0.1"blast_stop"id)
    }
}

public 
blast_stop(id)
{
    
message_begin(MSG_ONEgMsgBarTime_id)
    
write_byte(0)
    
write_byte(0)
    
message_end()
    
    
remove_task(id+TASK_BARTIME)
}

public 
blast_players(id)
{
    
id -= TASK_BARTIME
    
    
new FloatiOrigin[3]
    
pev(idpev_originiOrigin)
    
    
emit_sound(idCHAN_VOICEhoundeye_blast[random_num(0sizeof houndeye_blast 1)], 1.0ATTN_NORM0PITCH_NORM)
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYiOrigin0)
    
write_byte(TE_BEAMCYLINDER)
    
engfunc(EngFunc_WriteCoordiOrigin[0])
    
engfunc(EngFunc_WriteCoordiOrigin[1])
    
engfunc(EngFunc_WriteCoordiOrigin[2])
    
engfunc(EngFunc_WriteCoordiOrigin[0])
    
engfunc(EngFunc_WriteCoordiOrigin[1])
    
engfunc(EngFunc_WriteCoordiOrigin[2]+385.0)
    
write_short(gSprBeam)
    
write_byte(0)
    
write_byte(0)
    
write_byte(4)
    
write_byte(60)
    
write_byte(0)
    
write_byte(255)
    
write_byte(255)
    
write_byte(255)
    
write_byte(200)
    
write_byte(0)
    
message_end()
    
    static 
EntFloatoriginF[3]
    
    while( (
Ent engfunc(EngFunc_FindEntityInSphereEntiOriginget_pcvar_float(cvar_radius))) )
    {
        if( 
is_player(Ent) && Ent != id )
        {
            if(
is_user_zombie(Ent))
                return 
PLUGIN_CONTINUE;
                
            if(
get_pcvar_num(cvar_blast_infect))
            {
                
infect_user(Ent1)
                
                
SendDeathMsg(idEnt)
            }
            
            if(
get_pcvar_num(cvar_damage))
            {    
                
fm_set_user_health(Entpev(Entpev_health) - get_pcvar_num(cvar_damage_amount))
            }
            
            
pev(Entpev_originoriginF)
            
            
originF[0] = (originF[0] - iOrigin[0]) * 10.0 
            originF
[1] = (originF[1] - iOrigin[1]) * 10.0 
            originF
[2] = (originF[2] - iOrigin[2]) + 500.0
            
            set_pev
(Entpev_velocityoriginF)
        }
    }
    
    return 
PLUGIN_HANDLED;
}

SendDeathMsg(attackervictim)
{
    
message_begin(MSG_BROADCASTgMsgDeathMsg)
    
write_byte(attacker)
    
write_byte(victim)
    
write_byte(1)
    
write_string("infection")
    
message_end()
}

/*================================================================================
 [Stocks]
=================================================================================*/

stock print_chatColor(const id,const input[], any:...)
{
    new 
msg[191], players[32], count 1;
    
vformat(msg,190,input,3);
    
replace_all(msg,190,"!g","^4");// green
    
replace_all(msg,190,"!n","^1");// normal
    
replace_all(msg,190,"!t","^3");// team
    
    
if (idplayers[0] = id; else get_players(players,count,"ch");
    for (new 
i=0;i<count;i++)
    if (
is_user_connected(players[i]))
    {
        
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
        
write_byte(players[i]);
        
write_string(msg);
        
message_end();
    }
}

stock fm_set_user_health(idhealth)
{
    (
health 0) ? set_pev(idpev_healthfloat(health)) : dllfunc(DLLFunc_ClientKillid);

__________________
Check my original plugins for cs 1.6 and subscribe on channel
Look at the video bellow to see zombie frost grenade

https://youtu.be/j0zspNfN-AM?si=_1IiGPETN-GQY9Ua

Look at the video below to see Zombie blind grenade

https://youtu.be/ORC7ZmoaipQ?si=QC8Bul96QGitUwX4

Last edited by Krtola; 04-25-2019 at 06:42.
Krtola is offline
Send a message via Skype™ to Krtola